diff options
author | Ash Wolf <ninji@wuffs.org> | 2023-07-05 19:04:06 +0100 |
---|---|---|
committer | Ash Wolf <ninji@wuffs.org> | 2023-07-05 19:04:06 +0100 |
commit | 5e61c1280c15ab9969b94cd360cafd4a11b2dd30 (patch) | |
tree | 1fdb60d771c4351b5aa5dcf1a43376c0558625a4 /src/T2DLL/T2PeopleArray.cpp | |
parent | c2efba6907fab934a04959b9bb644cf7141cc955 (diff) | |
download | t2win-5e61c1280c15ab9969b94cd360cafd4a11b2dd30.tar.gz t2win-5e61c1280c15ab9969b94cd360cafd4a11b2dd30.zip |
matched T2.exe
Diffstat (limited to '')
-rw-r--r-- | src/T2DLL/T2PeopleArray.cpp | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/src/T2DLL/T2PeopleArray.cpp b/src/T2DLL/T2PeopleArray.cpp index f60debd..c5f37df 100644 --- a/src/T2DLL/T2PeopleArray.cpp +++ b/src/T2DLL/T2PeopleArray.cpp @@ -4,17 +4,17 @@ T2PeopleArray::T2PeopleArray(unsigned int startID) : T2ObjectArray(startID) { - for (unsigned int i = 0; i < 256; i++) + for (unsigned int i = 0; i < kGroupSize; i++) mPeople[i].mMatterID = mStartID + i; } T2People* T2PeopleArray::FindPeople(unsigned int peopleID) { unsigned int firstID = mPeople[0].GetPeopleID(); - if (firstID > peopleID || (firstID + 256) < peopleID) + if (firstID > peopleID || (firstID + kGroupSize) < peopleID) return NULL; - for (int i = 0; i < 256; i++) { + for (int i = 0; i < kGroupSize; i++) { if (mPeople[i].GetPeopleID() == peopleID) return &mPeople[i]; } @@ -23,7 +23,7 @@ T2People* T2PeopleArray::FindPeople(unsigned int peopleID) { } void T2PeopleArray::ResolveLink(T2PeopleArrayList* list) { - for (int i = 0; i < 256; i++) { + for (int i = 0; i < kGroupSize; i++) { if (mPeople[i].IsUsed()) mPeople[i].ResolveLink(list); } @@ -32,7 +32,7 @@ void T2PeopleArray::ResolveLink(T2PeopleArrayList* list) { T2People* T2PeopleArray::FindUnusedPeople() { T2People *result = NULL; - for (unsigned int i = 0; i < 256; i++) { + for (unsigned int i = 0; i < kGroupSize; i++) { if (!mPeople[i].IsUsed()) { result = &mPeople[i]; break; @@ -47,15 +47,15 @@ T2People* T2PeopleArray::FindUnusedPeople() { T2People *thePeople; thePeople = &mPeople[startIndex]; - for (i = startIndex; i < 256; i += 8) { + for (i = startIndex; i < kGroupSize; i += 8) { if (thePeople->mUsed) thePeople->Idle(towerDoc); thePeople += 8; } thePeople = mPeople; - int theWalkRate = towerDoc->towerDoc_vf148(); - for (i = 0; i < 256; i++) { + int theWalkRate = towerDoc->GetWalkRate(); + for (i = 0; i < kGroupSize; i++) { if (thePeople->mUsed) { if ((theWalkRate > 0 && !(i % theWalkRate)) || thePeople->IsSetSpecialFlag(kSpecialFlag20)) thePeople->IdleSearchedPerson(towerDoc); @@ -66,7 +66,7 @@ T2People* T2PeopleArray::FindUnusedPeople() { void T2PeopleArray::DrawSearchedPerson(T2TowerDoc* towerDoc) { T2People *people = mPeople; - for (int i = 0; i < 256; i++) { + for (int i = 0; i < kGroupSize; i++) { if (people->mUsed && people->IsWalk()) people->DrawSearchedPerson(towerDoc); people++; @@ -74,38 +74,38 @@ void T2PeopleArray::DrawSearchedPerson(T2TowerDoc* towerDoc) { } void T2PeopleArray::SetWalkPeople(int v) { - for (int i = 0; i < 256; i++) + for (int i = 0; i < kGroupSize; i++) mPeople[i].SetWalk(false); if (v != -1) { - for (int i = 0; i < 256; i += v) + for (int i = 0; i < kGroupSize; i += v) mPeople[i].SetWalk(true); } } void T2PeopleArray::DayChanged() { - for (int i = 0; i < 256; i++) { + for (int i = 0; i < kGroupSize; i++) { if (mPeople[i].IsUsed()) mPeople[i].DayChanged(); } } void T2PeopleArray::TenantRemoved(unsigned int v) { - for (int i = 0; i < 256; i++) { + for (int i = 0; i < kGroupSize; i++) { if (mPeople[i].IsUsed()) mPeople[i].TenantRemoved(v); } } void T2PeopleArray::AddStress(int v) { - for (int i = 0; i < 256; i++) { + for (int i = 0; i < kGroupSize; i++) { if (mPeople[i].IsUsed()) mPeople[i].IncStress(v); } } void T2PeopleArray::BreakoutEmergency(T2TowerDoc* towerDoc) { - for (int i = 0; i < 256; i++) { + for (int i = 0; i < kGroupSize; i++) { T2People *people = &mPeople[i]; if (people->IsUsed()) people->BreakoutEmergency(towerDoc); @@ -113,11 +113,11 @@ void T2PeopleArray::BreakoutEmergency(T2TowerDoc* towerDoc) { } void T2PeopleArray::Read(T2Archive& archive, T2TowerDoc* towerDoc) { - for (int i = 0; i < 256; i++) + for (int i = 0; i < kGroupSize; i++) mPeople[i].Load(archive, towerDoc); } void T2PeopleArray::Write(T2Archive& archive) { - for (int i = 0; i < 256; i++) + for (int i = 0; i < kGroupSize; i++) mPeople[i].Save(archive); } |