diff options
Diffstat (limited to 'src/T2DLL/T2RegistedTenantDB.cpp')
-rw-r--r-- | src/T2DLL/T2RegistedTenantDB.cpp | 100 |
1 files changed, 50 insertions, 50 deletions
diff --git a/src/T2DLL/T2RegistedTenantDB.cpp b/src/T2DLL/T2RegistedTenantDB.cpp index 81d0339..1aee876 100644 --- a/src/T2DLL/T2RegistedTenantDB.cpp +++ b/src/T2DLL/T2RegistedTenantDB.cpp @@ -33,28 +33,28 @@ void T2RegistedTenantDB::Init(T2TenantArrayList* tenantArrayList) { void T2RegistedTenantDB::AddItem(T2Tenant* tenant) { if (tenant->IsRegist()) { - unsigned int registID = tenant->GetRegistID(); - T2EquipPtrList *list = GetList(registID); + unsigned int theRegistID = tenant->GetRegistID(); + T2EquipPtrList *theList = GetList(theRegistID); - if (list) { - list->AddItem(tenant); + if (theList) { + theList->AddItem(tenant); } else { - list = new T2EquipPtrList(registID); + theList = new T2EquipPtrList(theRegistID); #line 55 - _ASSERT(list); - list->AddItem(tenant); - InsertItemsAt(1, mItemCount + 1, &list); + _ASSERT(theList != NULL); + theList->AddItem(tenant); + InsertItemsAt(1, mItemCount + 1, &theList); } } } void T2RegistedTenantDB::RemoveItem(T2Tenant* tenant) { if (tenant->IsRegist()) { - unsigned int registID = tenant->GetRegistID(); - T2EquipPtrList *list = GetList(registID); + unsigned int theRegistID = tenant->GetRegistID(); + T2EquipPtrList *theList = GetList(theRegistID); - if (list) - list->RemoveItem(tenant); + if (theList) + theList->RemoveItem(tenant); } } @@ -72,28 +72,28 @@ T2EquipPtrList* T2RegistedTenantDB::GetList(unsigned int registID) const { } T2Tenant* T2RegistedTenantDB::GetFirstTenant(unsigned int registID) const { - T2Tenant *tenant = NULL; - T2EquipPtrList *list = GetList(registID); - if (list) - tenant = (T2Tenant *) list->GetItem(1); - return tenant; + T2Tenant *theFirstTenant = NULL; + T2EquipPtrList *theList = GetList(registID); + if (theList) + theFirstTenant = (T2Tenant *) theList->GetItem(1); + return theFirstTenant; } -T2Tenant* T2RegistedTenantDB::SearchToilet(const T2RouteNavigator* routeNav, POINT pt, int& outVar) const { - T2Tenant *result = NULL; +T2Tenant* T2RegistedTenantDB::SearchToilet(const T2RouteNavigator* inNavi, POINT inPt, int& outVar) const { + T2Tenant *theSearchToilet = NULL; outVar = -1; - T2EquipPtrList *list = GetList(kTenantRegistID7); - if (list) { - LArrayIterator iterator(*list); - T2Tenant *tenant; - while (outVar != 0 && iterator.Next(&tenant)) { - POINT entrancePt = tenant->GetEntrancePt(); - if (routeNav->CheckRoute(pt, entrancePt, tenant->GetCustomerSearchScore())) { - int status = tenant->GetStatus(); + T2EquipPtrList *theRegistList = GetList(kTenantRegistID7); + if (theRegistList) { + LArrayIterator theTenantIter(*theRegistList); + T2Tenant *theTenant; + while (outVar != 0 && theTenantIter.Next(&theTenant)) { + POINT entrancePt = theTenant->GetEntrancePt(); + if (inNavi->CheckRoute(inPt, entrancePt, theTenant->GetCustomerSearchScore())) { + int status = theTenant->GetStatus(); if (status > kTenantStatus9 && status < kTenantStatus10000) { - if (!tenant->WillBeFull()) { - result = tenant; + if (!theTenant->WillBeFull()) { + theSearchToilet = theTenant; outVar = 0; } else { outVar = -2; @@ -103,37 +103,37 @@ T2Tenant* T2RegistedTenantDB::SearchToilet(const T2RouteNavigator* routeNav, POI } } - return result; + return theSearchToilet; } T2Tenant* T2RegistedTenantDB::FindEmptyParking() const { - T2Tenant *result = NULL; - - T2EquipPtrList *list = GetList(kTenantRegistID3); - if (list) { - LArrayIterator iterator(*list); - T2Tenant *tenant; - while (!result && iterator.Next(&tenant)) { - if (tenant->IsEmptyParking()) - result = tenant; + T2Tenant *theParking = NULL; + + T2EquipPtrList *theRegistList = GetList(kTenantRegistID3); + if (theRegistList) { + LArrayIterator theTenantIter(*theRegistList); + T2Tenant *theTenant; + while (!theParking && theTenantIter.Next(&theTenant)) { + if (theTenant->IsEmptyParking()) + theParking = theTenant; } } - return result; + return theParking; } T2Tenant* T2RegistedTenantDB::FindHisParking(T2People* people) const { - T2Tenant *result = NULL; - - T2EquipPtrList *list = GetList(kTenantRegistID3); - if (list) { - LArrayIterator iterator(*list); - T2Tenant *tenant; - while (!result && iterator.Next(&tenant)) { - if (tenant->IsBelongPeople(people)) - result = tenant; + T2Tenant *hisParking = NULL; + + T2EquipPtrList *theRegistList = GetList(kTenantRegistID3); + if (theRegistList) { + LArrayIterator theTenantIter(*theRegistList); + T2Tenant *theTenant; + while (!hisParking && theTenantIter.Next(&theTenant)) { + if (theTenant->IsBelongPeople(people)) + hisParking = theTenant; } } - return result; + return hisParking; } |