summaryrefslogtreecommitdiff
path: root/src/T2DLL/T2TemplatePluginList.cpp
diff options
context:
space:
mode:
authorAsh Wolf <ninji@wuffs.org>2023-07-01 02:43:29 +0100
committerAsh Wolf <ninji@wuffs.org>2023-07-01 02:43:29 +0100
commit5c6a48b2ff362a70416a6a00fda7d06e0f276f2d (patch)
tree62cf542c68d91aa6f7a4e3bfa9eddca4ab352970 /src/T2DLL/T2TemplatePluginList.cpp
parentc0c336500955a23e344651e5412c9d9d441ef4ee (diff)
downloadt2win-5c6a48b2ff362a70416a6a00fda7d06e0f276f2d.tar.gz
t2win-5c6a48b2ff362a70416a6a00fda7d06e0f276f2d.zip
i am in hell
Diffstat (limited to '')
-rw-r--r--src/T2DLL/T2TemplatePluginList.cpp102
1 files changed, 51 insertions, 51 deletions
diff --git a/src/T2DLL/T2TemplatePluginList.cpp b/src/T2DLL/T2TemplatePluginList.cpp
index 1d1158f..d67a81c 100644
--- a/src/T2DLL/T2TemplatePluginList.cpp
+++ b/src/T2DLL/T2TemplatePluginList.cpp
@@ -53,10 +53,10 @@ T2TenantDef* T2TemplatePluginList::FindFloor() {
return NULL;
LArrayIterator iterator(*this);
- T2TenantDef *plugin;
- while (iterator.Next(&plugin)) {
- if (plugin->IsFloor())
- return plugin;
+ T2TenantDef *theTenantDef;
+ while (iterator.Next(&theTenantDef)) {
+ if (theTenantDef->IsFloor())
+ return theTenantDef;
}
return NULL;
@@ -66,11 +66,11 @@ T2TenantDef* T2TemplatePluginList::FindTenantDef(int equipType) {
if (mPluginType != 'TnDf')
return NULL;
- LArrayIterator iterator(*this);
- T2TenantDef *plugin;
- while (iterator.Next(&plugin)) {
- if (plugin->GetEquipType() == equipType)
- return plugin;
+ LArrayIterator iter(*this);
+ T2TenantDef *theTemplatePlugin;
+ while (iter.Next(&theTemplatePlugin)) {
+ if (theTemplatePlugin->GetEquipType() == equipType)
+ return theTemplatePlugin;
}
return NULL;
@@ -80,11 +80,11 @@ T2MoverDef* T2TemplatePluginList::FindMoverDef(int equipType) {
if (mPluginType != 'MvDf')
return NULL;
- LArrayIterator iterator(*this);
- T2MoverDef *plugin;
- while (iterator.Next(&plugin)) {
- if (plugin->GetEquipType() == equipType)
- return plugin;
+ LArrayIterator iter(*this);
+ T2MoverDef *theTemplatePlugin;
+ while (iter.Next(&theTemplatePlugin)) {
+ if (theTemplatePlugin->GetEquipType() == equipType)
+ return theTemplatePlugin;
}
return NULL;
@@ -94,11 +94,11 @@ T2OuterObjDef* T2TemplatePluginList::FindOutObjDef(int toolType) {
if (mPluginType != 'OODf')
return NULL;
- LArrayIterator iterator(*this);
- T2OuterObjDef *plugin;
- while (iterator.Next(&plugin)) {
- if (plugin->GetToolType() == toolType)
- return plugin;
+ LArrayIterator iter(*this);
+ T2OuterObjDef *theTemplatePlugin;
+ while (iter.Next(&theTemplatePlugin)) {
+ if (theTemplatePlugin->GetToolType() == toolType)
+ return theTemplatePlugin;
}
return NULL;
@@ -108,11 +108,11 @@ T2PeopleDef* T2TemplatePluginList::FindPeopleDef(int peopleType) {
if (mPluginType != 'PPDf')
return NULL;
- LArrayIterator iterator(*this);
- T2PeopleDef *plugin;
- while (iterator.Next(&plugin)) {
- if (plugin->GetPeopleType() == peopleType)
- return plugin;
+ LArrayIterator iter(*this);
+ T2PeopleDef *theTemplatePlugin;
+ while (iter.Next(&theTemplatePlugin)) {
+ if (theTemplatePlugin->GetPeopleType() == peopleType)
+ return theTemplatePlugin;
}
return NULL;
@@ -122,51 +122,51 @@ T2SilhouetteDef* T2TemplatePluginList::FindSilhouette(int silhouetteType) {
if (mPluginType != 'SlDf')
return NULL;
- LArrayIterator iterator(*this);
- T2SilhouetteDef *plugin;
- while (iterator.Next(&plugin)) {
- if (plugin->GetSilhouetteType() == silhouetteType)
- return plugin;
+ LArrayIterator iter(*this);
+ T2SilhouetteDef *theTemplatePlugin;
+ while (iter.Next(&theTemplatePlugin)) {
+ if (theTemplatePlugin->GetSilhouetteType() == silhouetteType)
+ return theTemplatePlugin;
}
return NULL;
}
int T2TemplatePluginList::CalcCategoryCount() {
- int count = 0;
- LArray categories(sizeof(int));
- LArrayIterator toolDefIterator(*this);
- T2ToolDef *toolDef;
-
- while (toolDefIterator.Next(&toolDef)) {
- int categoryNo = toolDef->mCategoryNo;
- BOOL found = false;
-
- LArrayIterator categoryIterator(categories);
- int check;
- while (categoryIterator.Next(&check)) {
- if (check == categoryNo) {
- found = true;
+ int numCategory = 0;
+ LArray categoryIDs(sizeof(int));
+ LArrayIterator theDefIterator(*this);
+ T2ToolDef *def;
+
+ while (theDefIterator.Next(&def)) {
+ int toolCategoryNo = def->mCategoryNo;
+ BOOL done = false;
+
+ LArrayIterator theCategoryIterator(categoryIDs);
+ int theCategory;
+ while (theCategoryIterator.Next(&theCategory)) {
+ if (theCategory == toolCategoryNo) {
+ done = true;
break;
}
}
- if (!found) {
- categories.InsertItemsAt(1, categories.GetCount() + 1, &categoryNo);
- count++;
+ if (!done) {
+ categoryIDs.InsertItemsAt(1, categoryIDs.GetCount() + 1, &toolCategoryNo);
+ numCategory++;
}
}
- return count;
+ return numCategory;
}
void T2TemplatePluginList::DispatchIdle(T2TowerDoc* towerDoc) {
if (mPluginType != 'OODf' && mPluginType != 'MvDf' && mPluginType != 'TnDf')
return;
- LArrayIterator iterator(*this);
- T2ToolDef *toolDef;
+ LArrayIterator iter(*this);
+ T2ToolDef *theTemplatePlugin;
- while (iterator.Next(&toolDef))
- toolDef->DefIdleProc(towerDoc);
+ while (iter.Next(&theTemplatePlugin))
+ theTemplatePlugin->DefIdleProc(towerDoc);
}