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/T2RequestArrayList.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/T2RequestArrayList.cpp | 84 |
1 files changed, 42 insertions, 42 deletions
diff --git a/src/T2DLL/T2RequestArrayList.cpp b/src/T2DLL/T2RequestArrayList.cpp index 0b5acbb..8fac11a 100644 --- a/src/T2DLL/T2RequestArrayList.cpp +++ b/src/T2DLL/T2RequestArrayList.cpp @@ -11,36 +11,36 @@ T2RequestArrayList::T2RequestArrayList() /*virtual*/ T2RequestArrayList::~T2RequestArrayList() { LArrayIterator iterator(*this); - T2RequestArray *requestArray; + T2RequestArray *theRequestArray; - while (iterator.Next(&requestArray)) - delete requestArray; + while (iterator.Next(&theRequestArray)) + delete theRequestArray; } -void T2RequestArrayList::Add(T2RequestArray* requestArray) { - InsertItemsAt(1, mItemCount + 1, &requestArray); +void T2RequestArrayList::Add(T2RequestArray* inRequestArray) { + InsertItemsAt(1, mItemCount + 1, &inRequestArray); } unsigned int T2RequestArrayList::GetItemCount() { return GetCount(); } -T2RequestArray* T2RequestArrayList::GetItemAt(int index) { - T2RequestArray *requestArray; - if (FetchItemAt(index, &requestArray)) - return requestArray; +T2RequestArray* T2RequestArrayList::GetItemAt(int inIndex) { + T2RequestArray *theRequestArray; + if (FetchItemAt(inIndex, &theRequestArray)) + return theRequestArray; else return NULL; } -T2Request* T2RequestArrayList::GetRequestByID(unsigned int requestID) { - if (requestID == 0) +T2Request* T2RequestArrayList::GetRequestByID(unsigned int inRequestID) { + if (inRequestID == 0) return NULL; - if (requestID < 1000) + if (inRequestID < 1000) return NULL; - int group = (requestID - 1000) / 64; - int indexInGroup = (requestID - 1000) % 64; + int group = (inRequestID - 1000) / 64; + int indexInGroup = (inRequestID - 1000) % 64; T2RequestArray *requestArray = GetItemAt(group + 1); if (requestArray) return requestArray->GetIndexRequest(indexInGroup); @@ -49,67 +49,67 @@ T2Request* T2RequestArrayList::GetRequestByID(unsigned int requestID) { } T2Request* T2RequestArrayList::FindUnusedRequest() { - T2Request *result = NULL; + T2Request *theRequest = NULL; LArrayIterator iterator(*this); - T2RequestArray *requestArray = NULL; + T2RequestArray *theRequestArray = NULL; - while (!result && iterator.Next(&requestArray)) { - result = requestArray->FindUnusedRequest(); + while (!theRequest && iterator.Next(&theRequestArray)) { + theRequest = theRequestArray->FindUnusedRequest(); } - if (!result) { + if (!theRequest) { unsigned int newStartID = 1000; - if (requestArray) - newStartID = requestArray->GetStartID() + 64; + if (theRequestArray) + newStartID = theRequestArray->GetStartID() + 64; - requestArray = new T2RequestArray(newStartID); - if (requestArray) { - Add(requestArray); - result = requestArray->FindUnusedRequest(); + theRequestArray = new T2RequestArray(newStartID); + if (theRequestArray) { + Add(theRequestArray); + theRequest = theRequestArray->FindUnusedRequest(); } } - return result; + return theRequest; } -void T2RequestArrayList::BreakoutEmergency(T2TowerDoc* towerDoc) { +void T2RequestArrayList::BreakoutEmergency(T2TowerDoc* inDoc) { LArrayIterator iterator(*this); T2RequestArray *requestArray; while (iterator.Next(&requestArray)) - requestArray->BreakoutEmergency(towerDoc); + requestArray->BreakoutEmergency(inDoc); } -void T2RequestArrayList::Read(T2Archive& archive, T2TowerDoc* towerDoc) { +void T2RequestArrayList::Read(T2Archive& inArchive, T2TowerDoc* inDoc) { int count; - archive >> count; + inArchive >> count; RemoveItemsAt(GetCount(), 1); unsigned int startID = 1000; for (int i = 0; i < count; i++) { - T2RequestArray *requestArray = new T2RequestArray(startID); - requestArray->Read(archive, towerDoc); - Add(requestArray); + T2RequestArray *theRequestArray = new T2RequestArray(startID); + theRequestArray->Read(inArchive, inDoc); + Add(theRequestArray); startID += 64; } } -void T2RequestArrayList::Write(T2Archive& archive) { +void T2RequestArrayList::Write(T2Archive& inArchive) { int count = GetItemCount(); - archive << count; + inArchive << count; LArrayIterator iterator(*this); - T2RequestArray *requestArray; + T2RequestArray *theRequestArray; - while (iterator.Next(&requestArray)) - requestArray->Write(archive); + while (iterator.Next(&theRequestArray)) + theRequestArray->Write(inArchive); } -void T2RequestArrayList::DispatchIdle(T2TowerDoc* towerDoc) { +void T2RequestArrayList::DispatchIdle(T2TowerDoc* inDoc) { LArrayIterator iterator(*this); - T2RequestArray *requestArray; + T2RequestArray *theRequestArray; - while (iterator.Next(&requestArray)) - requestArray->DispatchIdle(towerDoc, 0); + while (iterator.Next(&theRequestArray)) + theRequestArray->DispatchIdle(inDoc, 0); } |