From c9afda3ab74614fb36986f96b7972c082f275eca Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Sat, 2 Jun 2007 18:12:48 +0000 Subject: Finished off all PokeMod classes, added move validations, fixed up some GUI, various other fixes git-svn-id: https://pokegen.svn.sourceforge.net/svnroot/pokegen/trunk@18 6ecfd1a5-f3ed-3746-8530-beee90d26b22 --- pokemod/Map.cpp | 34 +++++++++++++++------------------- 1 file changed, 15 insertions(+), 19 deletions(-) (limited to 'pokemod/Map.cpp') diff --git a/pokemod/Map.cpp b/pokemod/Map.cpp index f0349f50..32728d90 100644 --- a/pokemod/Map.cpp +++ b/pokemod/Map.cpp @@ -25,16 +25,12 @@ extern PokeGen::PokeMod::Pokemod curPokeMod; -PokeGen::PokeMod::Map::Map(const unsigned _id) +PokeGen::PokeMod::Map::Map(const unsigned _id) : + name(""), + flyWarp(UINT_MAX), + type(UINT_MAX) { LogCtor("Map", id); - name = ""; - flyWarp = 0; - type = 0; - effects.clear(); - trainers.clear(); - warps.clear(); - wildLists.clear(); id = _id; } @@ -234,16 +230,16 @@ void PokeGen::PokeMod::Map::ImportIni(Ini &ini, const unsigned _id) LogImportStart("Map"); if (_id == UINT_MAX) { - ini.GetValue("id", id, UINT_MAX); + ini.GetValue("id", id); // Was there an id associated with the element? if (id == UINT_MAX) LogIdNotFound("Map"); } else id = _id; - ini.GetValue("name", name, ""); - ini.GetValue("flyWarp", flyWarp, 0); - ini.GetValue("type", type, 0); + ini.GetValue("name", name); + ini.GetValue("flyWarp", flyWarp); + ini.GetValue("type", type); effects.clear(); trainers.clear(); warps.clear(); @@ -439,7 +435,7 @@ void PokeGen::PokeMod::Map::NewMapEffect(Ini *const ini) void PokeGen::PokeMod::Map::DeleteMapEffect(const unsigned _id) { LogSubmoduleRemoveStart("Map", id, "effect", _id, name); - for (std::vector::const_iterator i = effects.begin(); i != effects.end(); ++i) + for (std::vector::iterator i = effects.begin(); i != effects.end(); ++i) { if (i->GetId() == _id) { @@ -453,7 +449,7 @@ void PokeGen::PokeMod::Map::DeleteMapEffect(const unsigned _id) void PokeGen::PokeMod::Map::DeleteMapEffect(const String &n) { LogSubmoduleRemoveStart("Map", id, "effect", n, name); - for (std::vector::const_iterator i = effects.begin(); i != effects.end(); ++i) + for (std::vector::iterator i = effects.begin(); i != effects.end(); ++i) { if (i->GetName() == n) { @@ -513,7 +509,7 @@ void PokeGen::PokeMod::Map::NewMapTrainer(Ini *const ini) void PokeGen::PokeMod::Map::DeleteMapTrainer(const unsigned _id) { LogSubmoduleRemoveStart("Map", id, "trainer", _id, name); - for (std::vector::const_iterator i = trainers.begin(); i != trainers.end(); ++i) + for (std::vector::iterator i = trainers.begin(); i != trainers.end(); ++i) { if (i->GetId() == _id) { @@ -527,7 +523,7 @@ void PokeGen::PokeMod::Map::DeleteMapTrainer(const unsigned _id) void PokeGen::PokeMod::Map::DeleteMapTrainer(const String &n) { LogSubmoduleRemoveStart("Map", id, "trainer", n, name); - for (std::vector::const_iterator i = trainers.begin(); i != trainers.end(); ++i) + for (std::vector::iterator i = trainers.begin(); i != trainers.end(); ++i) { if (i->GetName() == n) { @@ -587,7 +583,7 @@ void PokeGen::PokeMod::Map::NewMapWarp(Ini *const ini) void PokeGen::PokeMod::Map::DeleteMapWarp(const unsigned _id) { LogSubmoduleRemoveStart("Map", id, "warp", _id, name); - for (std::vector::const_iterator i = warps.begin(); i != warps.end(); ++i) + for (std::vector::iterator i = warps.begin(); i != warps.end(); ++i) { if (i->GetId() == _id) { @@ -601,7 +597,7 @@ void PokeGen::PokeMod::Map::DeleteMapWarp(const unsigned _id) void PokeGen::PokeMod::Map::DeleteMapWarp(const String &n) { LogSubmoduleRemoveStart("Map", id, "warp", n, name); - for (std::vector::const_iterator i = warps.begin(); i != warps.end(); ++i) + for (std::vector::iterator i = warps.begin(); i != warps.end(); ++i) { if (i->GetName() == n) { @@ -649,7 +645,7 @@ void PokeGen::PokeMod::Map::NewMapWildList(Ini *const ini) void PokeGen::PokeMod::Map::DeleteMapWildList(const unsigned _id) { LogSubmoduleRemoveStart("Map", id, "wild list", _id, name); - for (std::vector::const_iterator i = wildLists.begin(); i != wildLists.end(); ++i) + for (std::vector::iterator i = wildLists.begin(); i != wildLists.end(); ++i) { if (i->GetId() == _id) { -- cgit