From 5c3ca621f75587173bab3d946aee81dd2d36f495 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Fri, 22 Jun 2007 17:46:50 +0000 Subject: Pokemod validation, paths made to default git-svn-id: https://pokegen.svn.sourceforge.net/svnroot/pokegen/trunk@20 6ecfd1a5-f3ed-3746-8530-beee90d26b22 --- pokemod/Tile.cpp | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'pokemod/Tile.cpp') diff --git a/pokemod/Tile.cpp b/pokemod/Tile.cpp index 7e3e7153..36cc5bc5 100644 --- a/pokemod/Tile.cpp +++ b/pokemod/Tile.cpp @@ -23,9 +23,7 @@ #include "Tile.h" -extern PokeGen::PokeMod::Pokemod curPokeMod; - -PokeGen::PokeMod::Tile::Tile(const unsigned _id) : +PokeGen::PokeMod::Tile::Tile(const Pokemod *par, const unsigned _id) : name(""), pic(""), fromUp(false), @@ -46,11 +44,13 @@ PokeGen::PokeMod::Tile::Tile(const unsigned _id) : { LogCtor("Tile", id); id = _id; + pokemod = par; } -PokeGen::PokeMod::Tile::Tile(Ini &ini, const unsigned _id) +PokeGen::PokeMod::Tile::Tile(const Pokemod *par, Ini &ini, const unsigned _id) { LogCtorIni("Tile", id); + pokemod = par; ImportIni(ini, _id); if (id == UINT_MAX) LogIdError("Tile"); @@ -86,7 +86,7 @@ void PokeGen::PokeMod::Tile::Validate() } else if (waterType == WTRT_WHIRLPOOL) { - if (!curPokeMod.GetTile(underWater)) + if (!pokemod->GetTile(underWater)) { LogVarNotValid("Tile", id, "underWater", name); isValid = false; @@ -95,7 +95,7 @@ void PokeGen::PokeMod::Tile::Validate() } if (isCuttable) { - if (!curPokeMod.GetTile(underCut)) + if (!pokemod->GetTile(underCut)) { LogVarNotValid("Tile", id, "underCut", name); isValid = false; @@ -154,7 +154,7 @@ void PokeGen::PokeMod::Tile::Validate(const wxListBox &output) } else if (waterType == WT_WHIRLPOOL) { - if (!curPokeMod.GetTile(underWater)) + if (!pokemod->GetTile(underWater)) { LogVarNotValid("Tile", id, "underWater", name); output.Append(Console); @@ -164,7 +164,7 @@ void PokeGen::PokeMod::Tile::Validate(const wxListBox &output) } if (isCuttable) { - if (!curPokeMod.GetTile(underCut)) + if (!pokemod->GetTile(underCut)) { LogVarNotValid("Tile", id, "underCut", name); output.Append(Console); @@ -342,14 +342,14 @@ void PokeGen::PokeMod::Tile::SetWaterType(const String &w) void PokeGen::PokeMod::Tile::SetUnderWater(const unsigned u) { LogSetVar("Tile", id, "underWater", u, name); - if (curPokeMod.GetTile(u)) + if (pokemod->GetTile(u)) underWater = u; } void PokeGen::PokeMod::Tile::SetUnderWater(const String &u) { LogSetVar("Tile", id, "underWater string", u, name); - if (const Tile *t = curPokeMod.GetTile(u)) + if (const Tile *t = pokemod->GetTile(u)) underWater = t->GetId(); } @@ -368,14 +368,14 @@ void PokeGen::PokeMod::Tile::SetIsCuttable(const bool i) void PokeGen::PokeMod::Tile::SetUnderCut(const unsigned u) { LogSetVar("Tile", id, "underCut", u, name); - if (curPokeMod.GetTile(u)) + if (pokemod->GetTile(u)) underCut = u; } void PokeGen::PokeMod::Tile::SetUnderCut(const String &u) { LogSetVar("Tile", id, "underCut string", u, name); - if (const Tile *t = curPokeMod.GetTile(u)) + if (const Tile *t = pokemod->GetTile(u)) underCut = t->GetId(); } @@ -498,7 +498,7 @@ unsigned PokeGen::PokeMod::Tile::GetUnderWater() const PokeGen::PokeMod::String PokeGen::PokeMod::Tile::GetUnderWaterString() const { LogFetchVar("Tile", id, "underWater", underWater, name); - if (const Tile *t = curPokeMod.GetTile(underWater)) + if (const Tile *t = pokemod->GetTile(underWater)) return t->GetName(); return ""; } @@ -524,7 +524,7 @@ unsigned PokeGen::PokeMod::Tile::GetUnderCut() const PokeGen::PokeMod::String PokeGen::PokeMod::Tile::GetUnderCutString() const { LogFetchVar("Tile", id, "underCut string", underCut, name); - if (const Tile *t = curPokeMod.GetTile(underCut)) + if (const Tile *t = pokemod->GetTile(underCut)) return t->GetName(); return ""; } -- cgit