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/T2ElvModuleList.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/T2ElvModuleList.cpp | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/src/T2DLL/T2ElvModuleList.cpp b/src/T2DLL/T2ElvModuleList.cpp index d1f2224..4fc835b 100644 --- a/src/T2DLL/T2ElvModuleList.cpp +++ b/src/T2DLL/T2ElvModuleList.cpp @@ -63,43 +63,43 @@ void T2ElvModuleList::CalcBaseQDRect(RECT& outRect) { } int T2ElvModuleList::DestructModule(T2TowerDoc* towerDoc, T2Mover* mover, POINT inPt) { - int result = -1; - int zoomLevel = towerDoc->towerDoc_vf108(); + RECT theBaseQDRect; + int theModuleIndex = -1; + int theZoomLevel = towerDoc->towerDoc_vf108(); POINT pt = inPt; - RECT baseQDRect; - CalcBaseQDRect(baseQDRect); + CalcBaseQDRect(theBaseQDRect); - T2ElevatorModule *foundModule = NULL; - LArrayIterator iterator(*this, GetCount() + 1); - T2ElevatorModule *elevatorModule; + T2ElevatorModule *theElevatorModuleToRemove = NULL; + LArrayIterator iter(*this, GetCount() + 1); + T2ElevatorModule *theModule; - while (!foundModule && iterator.Previous(&elevatorModule)) { - if (elevatorModule->IsPtInArea(pt, baseQDRect)) - foundModule = elevatorModule; + while (!theElevatorModuleToRemove && iter.Previous(&theModule)) { + if (theModule->IsPtInArea(pt, theBaseQDRect)) + theElevatorModuleToRemove = theModule; } - if (foundModule) { - result = foundModule->GetIndex(); - foundModule->Remove(towerDoc, mover); + if (theElevatorModuleToRemove) { + theModuleIndex = theElevatorModuleToRemove->GetIndex(); + theElevatorModuleToRemove->Remove(towerDoc, mover); mModuleCount--; } - return result; + return theModuleIndex; } BOOL T2ElvModuleList::IsHomePosition(int position) { - BOOL result = false; + BOOL isHomePosition = false; LArrayIterator iterator(*this); - T2ElevatorModule *elevatorModule = NULL; + T2ElevatorModule *theModule = NULL; - while (iterator.Next(&elevatorModule) && !result) { - if (elevatorModule && elevatorModule->GetHomePosition() == position) - result = true; + while (iterator.Next(&theModule) && !isHomePosition) { + if (theModule && theModule->GetHomePosition() == position) + isHomePosition = true; } - return result; + return isHomePosition; } void T2ElvModuleList::MoverExpanded(T2Mover* mover, EEquipPos pos, int count) { @@ -138,13 +138,13 @@ void T2ElvModuleList::MoverExpanded(T2Mover* mover, EEquipPos pos, int count) { /*virtual*/ void T2ElvModuleList::Read(T2Archive& archive, T2TowerDoc* towerDoc) { T2MoverModuleList::Read(archive, towerDoc); - int count; - archive >> count; - mMaxModule = count; + int numOfModules; + archive >> numOfModules; + mMaxModule = numOfModules; BOOL ok = true; - for (int i = 0; i < count && ok; i++) { + for (int i = 0; i < numOfModules && ok; i++) { T2ElevatorModule *elevatorModule = new T2ElevatorModule(i); if (elevatorModule) { elevatorModule->Load(archive, towerDoc); @@ -152,11 +152,11 @@ void T2ElvModuleList::MoverExpanded(T2Mover* mover, EEquipPos pos, int count) { } } - LArrayIterator iterator(*this); - T2ElevatorModule *elevatorModule; + LArrayIterator iter(*this); + T2ElevatorModule *theModule; - while (iterator.Next(&elevatorModule)) { - if (elevatorModule->IsUsed()) + while (iter.Next(&theModule)) { + if (theModule->IsUsed()) mModuleCount++; } |