diff options
author | Eugene Sandulenko | 2016-01-09 01:34:06 +0100 |
---|---|---|
committer | Eugene Sandulenko | 2016-01-09 01:34:06 +0100 |
commit | 3906c368981f19a3f710a4742578ac4d42001e56 (patch) | |
tree | 9d857855ef245595f2edd9775a3b72b3c020efa9 | |
parent | 9b8e5020bfae37505cf178aa6604882ee84d12c2 (diff) | |
download | scummvm-rg350-3906c368981f19a3f710a4742578ac4d42001e56.tar.gz scummvm-rg350-3906c368981f19a3f710a4742578ac4d42001e56.tar.bz2 scummvm-rg350-3906c368981f19a3f710a4742578ac4d42001e56.zip |
WAGE: Put lists into typedefs
-rw-r--r-- | engines/wage/combat.cpp | 2 | ||||
-rw-r--r-- | engines/wage/entities.cpp | 4 | ||||
-rw-r--r-- | engines/wage/entities.h | 7 | ||||
-rw-r--r-- | engines/wage/gui.cpp | 4 | ||||
-rw-r--r-- | engines/wage/script.cpp | 12 | ||||
-rw-r--r-- | engines/wage/script.h | 2 | ||||
-rw-r--r-- | engines/wage/wage.cpp | 2 | ||||
-rw-r--r-- | engines/wage/world.h | 4 |
8 files changed, 19 insertions, 18 deletions
diff --git a/engines/wage/combat.cpp b/engines/wage/combat.cpp index 102302a097..8f3e5154d5 100644 --- a/engines/wage/combat.cpp +++ b/engines/wage/combat.cpp @@ -139,7 +139,7 @@ void WageEngine::performCombatAction(Chr *npc, Chr *player) { hat.addTokens(kTokOffer, npc->_losingOffer + 1); } - Common::List<Obj *> *objs = &npc->_currentScene->_objs; + ObjList *objs = &npc->_currentScene->_objs; if (npc->_inventory.size() < npc->_maximumCarriedObjects) { int cnt = 0; for (ObjList::const_iterator it = objs->begin(); it != objs->end(); ++it, ++cnt) { diff --git a/engines/wage/entities.cpp b/engines/wage/entities.cpp index 753084ebe6..64e919b978 100644 --- a/engines/wage/entities.cpp +++ b/engines/wage/entities.cpp @@ -138,12 +138,12 @@ void Scene::paint(Graphics::Surface *surface, int x, int y) { _design->paint(surface, ((WageEngine *)g_engine)->_world->_patterns, x, y); - for (Common::List<Obj *>::const_iterator it = _objs.begin(); it != _objs.end(); ++it) { + for (ObjList::const_iterator it = _objs.begin(); it != _objs.end(); ++it) { debug(2, "paining Obj: %s", (*it)->_name.c_str()); (*it)->_design->paint(surface, ((WageEngine *)g_engine)->_world->_patterns, x, y); } - for (Common::List<Chr *>::const_iterator it = _chrs.begin(); it != _chrs.end(); ++it) { + for (ChrList::const_iterator it = _chrs.begin(); it != _chrs.end(); ++it) { debug(2, "paining Chr: %s", (*it)->_name.c_str()); (*it)->_design->paint(surface, ((WageEngine *)g_engine)->_world->_patterns, x, y); } diff --git a/engines/wage/entities.h b/engines/wage/entities.h index 4cf756a64e..5f1c968424 100644 --- a/engines/wage/entities.h +++ b/engines/wage/entities.h @@ -64,6 +64,7 @@ typedef Common::Array<Weapon *> WeaponArray; typedef Common::Array<Obj *> ObjArray; typedef Common::Array<Chr *> ChrArray; typedef Common::List<Obj *> ObjList; +typedef Common::List<Chr *> ChrList; enum StatVariable { /** The base physical accuracy of the player. */ @@ -212,7 +213,7 @@ public: String _dyingWords; Scene *_currentScene; - Common::Array<Obj *> _inventory; + ObjArray _inventory; Obj *_armor[NUMBER_OF_ARMOR_TYPES]; @@ -342,8 +343,8 @@ public: int _worldY; bool _visited; - Common::List<Obj *> _objs; - Common::List<Chr *> _chrs; + ObjList _objs; + ChrList _chrs; Scene(); Scene(String name, Common::SeekableReadStream *data); diff --git a/engines/wage/gui.cpp b/engines/wage/gui.cpp index 3e97f11e59..7cabe6ddd0 100644 --- a/engines/wage/gui.cpp +++ b/engines/wage/gui.cpp @@ -639,12 +639,12 @@ Designed *Gui::getClickTarget(int x, int y) { _bordersDirty = true; } - for (Common::List<Obj *>::const_iterator it = _scene->_objs.begin(); it != _scene->_objs.end(); ++it) { + for (ObjList::const_iterator it = _scene->_objs.begin(); it != _scene->_objs.end(); ++it) { if ((*it)->_design->isPointOpaque(x - _sceneArea.left + kBorderWidth, y - _sceneArea.top + kBorderWidth)) return *it; } - for (Common::List<Chr *>::const_iterator it = _scene->_chrs.begin(); it != _scene->_chrs.end(); ++it) { + for (ChrList::const_iterator it = _scene->_chrs.begin(); it != _scene->_chrs.end(); ++it) { if ((*it)->_design->isPointOpaque(x - _sceneArea.left + kBorderWidth, y - _sceneArea.top + kBorderWidth)) return *it; } diff --git a/engines/wage/script.cpp b/engines/wage/script.cpp index 71c75d9b40..48e01c029f 100644 --- a/engines/wage/script.cpp +++ b/engines/wage/script.cpp @@ -588,17 +588,17 @@ bool Script::compare(Operand *o1, Operand *o2, int comparator) { case kCompEqNumNum: return o1->_value.number == o2->_value.number; case kCompEqObjScene: - for (Common::List<Obj *>::const_iterator it = o2->_value.scene->_objs.begin(); it != o2->_value.scene->_objs.end(); ++it) + for (ObjList::const_iterator it = o2->_value.scene->_objs.begin(); it != o2->_value.scene->_objs.end(); ++it) if (*it == o1->_value.obj) return true; return false; case kCompEqChrScene: - for (Common::List<Chr *>::const_iterator it = o2->_value.scene->_chrs.begin(); it != o2->_value.scene->_chrs.end(); ++it) + for (ChrList::const_iterator it = o2->_value.scene->_chrs.begin(); it != o2->_value.scene->_chrs.end(); ++it) if (*it == o1->_value.chr) return true; return false; case kCompEqObjChr: - for (Common::Array<Obj *>::const_iterator it = o2->_value.chr->_inventory.begin(); it != o2->_value.chr->_inventory.end(); ++it) + for (ObjArray::const_iterator it = o2->_value.chr->_inventory.begin(); it != o2->_value.chr->_inventory.end(); ++it) if (*it == o1->_value.obj) return true; return false; @@ -988,9 +988,9 @@ void Script::handleLookCommand() { } Common::String *Script::getGroundItemsList(Scene *scene) { - Common::Array<Obj *> objs; + ObjArray objs; - for (Common::List<Obj *>::const_iterator it = scene->_objs.begin(); it != scene->_objs.end(); ++it) + for (ObjList::const_iterator it = scene->_objs.begin(); it != scene->_objs.end(); ++it) if ((*it)->_type != Obj::IMMOBILE_OBJECT) objs.push_back(*it); @@ -1002,7 +1002,7 @@ Common::String *Script::getGroundItemsList(Scene *scene) { return NULL; } -void Script::appendObjNames(Common::String &str, Common::Array<Obj *> &objs) { +void Script::appendObjNames(Common::String &str, ObjArray &objs) { for (uint i = 0; i < objs.size(); i++) { Obj *obj = objs[i]; diff --git a/engines/wage/script.h b/engines/wage/script.h index adb18132b2..529efa8bf4 100644 --- a/engines/wage/script.h +++ b/engines/wage/script.h @@ -174,7 +174,7 @@ private: void handleMoveCommand(Scene::Directions dir, const char *dirName); void handleLookCommand(); Common::String *getGroundItemsList(Scene *scene); - void appendObjNames(Common::String &str, Common::Array<Obj *> &objs); + void appendObjNames(Common::String &str, ObjArray &objs); void handleInventoryCommand(); void handleStatusCommand(); void handleRestCommand(); diff --git a/engines/wage/wage.cpp b/engines/wage/wage.cpp index 920f8feb86..eaadfea052 100644 --- a/engines/wage/wage.cpp +++ b/engines/wage/wage.cpp @@ -370,7 +370,7 @@ void WageEngine::processTurnInternal(Common::String *textInput, Designed *clickI _running = NULL; _offer = NULL; - for (Common::List<Chr *>::const_iterator it = playerScene->_chrs.begin(); it != playerScene->_chrs.end(); ++it) { + for (ChrList::const_iterator it = playerScene->_chrs.begin(); it != playerScene->_chrs.end(); ++it) { if (!(*it)->_playerCharacter) { _monster = *it; shouldEncounter = true; diff --git a/engines/wage/world.h b/engines/wage/world.h index 6afd1afb33..f59564fe56 100644 --- a/engines/wage/world.h +++ b/engines/wage/world.h @@ -81,8 +81,8 @@ public: Common::HashMap<String, Chr *> _chrs; Common::HashMap<String, Sound *> _sounds; Common::Array<Scene *> _orderedScenes; - Common::Array<Obj *> _orderedObjs; - Common::Array<Chr *> _orderedChrs; + ObjArray _orderedObjs; + ChrArray _orderedChrs; Common::Array<Sound *> _orderedSounds; Patterns _patterns; Scene *_storageScene; |