summaryrefslogtreecommitdiffstats
path: root/pokemod/Tile.cpp
diff options
context:
space:
mode:
authorBen Boeckel <MathStuf@gmail.com>2007-06-22 17:46:50 +0000
committerBen Boeckel <MathStuf@gmail.com>2007-06-22 17:46:50 +0000
commit5c3ca621f75587173bab3d946aee81dd2d36f495 (patch)
tree2d64b74bbe323a582cdc17f0a442c5ff1b48038e /pokemod/Tile.cpp
parent3595239f08f2bc1df32ef22ed6de9bde10ca3384 (diff)
Pokemod validation, paths made to default
git-svn-id: https://pokegen.svn.sourceforge.net/svnroot/pokegen/trunk@20 6ecfd1a5-f3ed-3746-8530-beee90d26b22
Diffstat (limited to 'pokemod/Tile.cpp')
-rw-r--r--pokemod/Tile.cpp28
1 files changed, 14 insertions, 14 deletions
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 "";
}