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/T2TenantArrayList.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/T2TenantArrayList.cpp | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/src/T2DLL/T2TenantArrayList.cpp b/src/T2DLL/T2TenantArrayList.cpp index be01aeb..f6cb81d 100644 --- a/src/T2DLL/T2TenantArrayList.cpp +++ b/src/T2DLL/T2TenantArrayList.cpp @@ -57,27 +57,27 @@ T2Tenant* T2TenantArrayList::GetTenantByPID(DWORD pluginID) { } T2Tenant* T2TenantArrayList::FindUnusedTenant() { - T2Tenant *result = NULL; + T2Tenant *theUnusedTenant = NULL; LArrayIterator iterator(*this); - T2TenantArray *tenantArray = NULL; + T2TenantArray *theTenantArray = NULL; - while (!result && iterator.Next(&tenantArray)) { - result = tenantArray->FindUnusedTenant(); + while (!theUnusedTenant && iterator.Next(&theTenantArray)) { + theUnusedTenant = theTenantArray->FindUnusedTenant(); } - if (!result) { + if (!theUnusedTenant) { unsigned int newStartID = 1000; - if (tenantArray) - newStartID = tenantArray->GetStartID() + T2TenantArray::kGroupSize; + if (theTenantArray) + newStartID = theTenantArray->GetStartID() + T2TenantArray::kGroupSize; - tenantArray = new T2TenantArray(newStartID); - if (tenantArray) { - Add(tenantArray); - result = tenantArray->FindUnusedTenant(); + theTenantArray = new T2TenantArray(newStartID); + if (theTenantArray) { + Add(theTenantArray); + theUnusedTenant = theTenantArray->FindUnusedTenant(); } } - return result; + return theUnusedTenant; } void T2TenantArrayList::DispatchIdle(T2TowerDoc* towerDoc) { @@ -109,14 +109,14 @@ void T2TenantArrayList::BreakoutEmergency(T2TowerDoc* towerDoc) { } int T2TenantArrayList::CalcMentenanceCost(T2TowerDoc* towerDoc) const { - int cost = 0; + int theCost = 0; LArrayIterator iterator(*this); - T2TenantArray *tenantArray; + T2TenantArray *theTenantArray; - while (iterator.Next(&tenantArray)) - cost += tenantArray->CalcMentenanceCost(towerDoc); + while (iterator.Next(&theTenantArray)) + theCost += theTenantArray->CalcMentenanceCost(towerDoc); - return cost; + return theCost; } LArray* T2TenantArrayList::MakeTenantList(int type) { @@ -177,11 +177,11 @@ void T2TenantArrayList::Read(T2Archive& archive, T2TowerDoc* towerDoc) { startID += T2TenantArray::kGroupSize; } - LArrayIterator iterator(*this); - T2TenantArray *tenantArray; + LArrayIterator iter(*this); + T2TenantArray *theTenantArray; - while (iterator.Next(&tenantArray)) - tenantArray->Read(archive, towerDoc); + while (iter.Next(&theTenantArray)) + theTenantArray->Read(archive, towerDoc); } void T2TenantArrayList::Write(T2Archive& archive) { |