diff options
author | Ash Wolf <ninji@wuffs.org> | 2023-07-01 23:04:04 +0100 |
---|---|---|
committer | Ash Wolf <ninji@wuffs.org> | 2023-07-01 23:04:04 +0100 |
commit | c2efba6907fab934a04959b9bb644cf7141cc955 (patch) | |
tree | c047244f99870e44a7a5d7e733c2857434c03765 /src/T2DLL/T2RegistedTenantDB.cpp | |
parent | 1eb8da84d77d0c865623421069ec38bfc7b0d461 (diff) | |
download | t2win-c2efba6907fab934a04959b9bb644cf7141cc955.tar.gz t2win-c2efba6907fab934a04959b9bb644cf7141cc955.zip |
matched T2DLL as well as i can
Diffstat (limited to '')
-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; } |