summaryrefslogtreecommitdiffstats
path: root/pokemod/PokemonEvolution.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/PokemonEvolution.cpp
parent3595239f08f2bc1df32ef22ed6de9bde10ca3384 (diff)
downloadsigen-5c3ca621f75587173bab3d946aee81dd2d36f495.tar.gz
sigen-5c3ca621f75587173bab3d946aee81dd2d36f495.tar.xz
sigen-5c3ca621f75587173bab3d946aee81dd2d36f495.zip
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/PokemonEvolution.cpp')
-rw-r--r--pokemod/PokemonEvolution.cpp34
1 files changed, 17 insertions, 17 deletions
diff --git a/pokemod/PokemonEvolution.cpp b/pokemod/PokemonEvolution.cpp
index cfc424db..3543768a 100644
--- a/pokemod/PokemonEvolution.cpp
+++ b/pokemod/PokemonEvolution.cpp
@@ -23,9 +23,7 @@
#include "PokemonEvolution.h"
-extern PokeGen::PokeMod::Pokemod curPokeMod;
-
-PokeGen::PokeMod::PokemonEvolution::PokemonEvolution(const unsigned _id) :
+PokeGen::PokeMod::PokemonEvolution::PokemonEvolution(const Pokemod *par, const unsigned _id) :
species(UINT_MAX),
style(UINT_MAX),
level(0),
@@ -34,11 +32,13 @@ PokeGen::PokeMod::PokemonEvolution::PokemonEvolution(const unsigned _id) :
{
LogCtor("PokemonEvolution", _id);
id = _id;
+ pokemod = par;
}
-PokeGen::PokeMod::PokemonEvolution::PokemonEvolution(Ini &ini, const unsigned _id)
+PokeGen::PokeMod::PokemonEvolution::PokemonEvolution(const Pokemod *par, Ini &ini, const unsigned _id)
{
LogCtorIni("PokemonEvolution", _id);
+ pokemod = par;
ImportIni(ini, _id);
if (id == UINT_MAX)
LogIdError("PokemonEvolution");
@@ -52,7 +52,7 @@ PokeGen::PokeMod::PokemonEvolution::~PokemonEvolution()
void PokeGen::PokeMod::PokemonEvolution::Validate()
{
LogValidateStart("PokemonEvolution", id);
- if (!curPokeMod.GetPokemon(species))
+ if (!pokemod->GetPokemon(species))
{
LogVarNotValid("PokemonEvolution", id, "species");
isValid = false;
@@ -62,12 +62,12 @@ void PokeGen::PokeMod::PokemonEvolution::Validate()
LogVarNotValid("PokemonEvolution", id, "style");
isValid = false;
}
- if (curPokeMod.GetMaxLevel() <= level)
+ if (pokemod->GetMaxLevel() <= level)
{
LogVarNotValid("PokemonEvolution", id, "level");
isValid = false;
}
- if (!curPokeMod.GetItem(item))
+ if (!pokemod->GetItem(item))
{
LogVarNotValid("PokemonEvolution", id, "species");
isValid = false;
@@ -79,7 +79,7 @@ void PokeGen::PokeMod::PokemonEvolution::Validate()
void PokeGen::PokeMod::PokemonEvolution::Validate(const wxListBox &output)
{
LogValidateStart("PokemonEvolution", id);
- if (!curPokeMod.GetPokemon(species))
+ if (!pokemod->GetPokemon(species))
{
LogVarNotValid("PokemonEvolution", id, "species");
output.Append(ConsoleLogVarNotValid("PokemonEvolution", id, "move"));
@@ -91,13 +91,13 @@ void PokeGen::PokeMod::PokemonEvolution::Validate(const wxListBox &output)
output.Append("Error (PokemonEvolution): Style out of range");
isValid = false;
}
- if (curPokeMod.GetMaxLevel() <= level)
+ if (pokemod->GetMaxLevel() <= level)
{
LogVarNotValid("PokemonEvolution", id, "level");
output.Append("Error (PokemonEvolution): Level out of range");
isValid = false;
}
- if (!curPokeMod.GetItem(item))
+ if (!pokemod->GetItem(item))
{
LogVarNotValid("PokemonEvolution", id, "species");
output.Append(ConsoleLogVarNotValid("PokemonEvolution", id, "species"));
@@ -143,14 +143,14 @@ void PokeGen::PokeMod::PokemonEvolution::ExportIni(std::ofstream &fout, const St
void PokeGen::PokeMod::PokemonEvolution::SetSpecies(const unsigned s)
{
LogSetVar("PokemonEvolution", id, "species", s);
- if (curPokeMod.GetPokemon(s))
+ if (pokemod->GetPokemon(s))
species = s;
}
void PokeGen::PokeMod::PokemonEvolution::SetSpecies(const String &s)
{
LogSetVar("PokemonEvolution", id, "species", s);
- if (const Pokemon *temp = curPokeMod.GetPokemon(s))
+ if (const Pokemon *temp = pokemod->GetPokemon(s))
species = temp->GetId();
}
@@ -164,21 +164,21 @@ void PokeGen::PokeMod::PokemonEvolution::SetStyle(const unsigned s)
void PokeGen::PokeMod::PokemonEvolution::SetLevel(const unsigned l)
{
LogSetVar("PokemonEvolution", id, "level", l);
- if (l <= curPokeMod.GetMaxLevel())
+ if (l <= pokemod->GetMaxLevel())
level = l;
}
void PokeGen::PokeMod::PokemonEvolution::SetItem(const unsigned i)
{
LogSetVar("PokemonEvolution", id, "item", i);
- if (curPokeMod.GetItem(i))
+ if (pokemod->GetItem(i))
item = i;
}
void PokeGen::PokeMod::PokemonEvolution::SetItem(const String &i)
{
LogSetVar("PokemonEvolution", id, "item", i);
- if (const Item *temp = curPokeMod.GetItem(i))
+ if (const Item *temp = pokemod->GetItem(i))
item = temp->GetId();
}
@@ -197,7 +197,7 @@ unsigned PokeGen::PokeMod::PokemonEvolution::GetSpecies() const
PokeGen::PokeMod::String PokeGen::PokeMod::PokemonEvolution::GetSpeciesString() const
{
LogFetchVar("PokemonEvolution", id, "species string", species);
- if (const Pokemon *s = curPokeMod.GetPokemon(species))
+ if (const Pokemon *s = pokemod->GetPokemon(species))
return s->GetName();
return "";
}
@@ -231,7 +231,7 @@ unsigned PokeGen::PokeMod::PokemonEvolution::GetItem() const
PokeGen::PokeMod::String PokeGen::PokeMod::PokemonEvolution::GetItemString() const
{
LogFetchVar("PokemonEvolution", id, "item string", item);
- if (const Item *i = curPokeMod.GetItem(item))
+ if (const Item *i = pokemod->GetItem(item))
return i->GetName();
return "";
}