diff options
| author | Ben Boeckel <MathStuf@gmail.com> | 2007-06-22 17:46:50 +0000 |
|---|---|---|
| committer | Ben Boeckel <MathStuf@gmail.com> | 2007-06-22 17:46:50 +0000 |
| commit | 5c3ca621f75587173bab3d946aee81dd2d36f495 (patch) | |
| tree | 2d64b74bbe323a582cdc17f0a442c5ff1b48038e /pokemod/MapTrainerTeam.cpp | |
| parent | 3595239f08f2bc1df32ef22ed6de9bde10ca3384 (diff) | |
| download | sigen-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/MapTrainerTeam.cpp')
| -rw-r--r-- | pokemod/MapTrainerTeam.cpp | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/pokemod/MapTrainerTeam.cpp b/pokemod/MapTrainerTeam.cpp index 6e61bee9..6cdd8e03 100644 --- a/pokemod/MapTrainerTeam.cpp +++ b/pokemod/MapTrainerTeam.cpp @@ -23,20 +23,20 @@ #include "MapTrainerTeam.h"
-extern PokeGen::PokeMod::Pokemod curPokeMod;
-
-PokeGen::PokeMod::MapTrainerTeam::MapTrainerTeam(const unsigned _id) :
+PokeGen::PokeMod::MapTrainerTeam::MapTrainerTeam(const Pokemod *par, const unsigned _id) :
species(UINT_MAX),
level(1),
item(UINT_MAX)
{
LogCtor("MapTrainerTeam", _id);
id = _id;
+ pokemod = par;
}
-PokeGen::PokeMod::MapTrainerTeam::MapTrainerTeam(Ini &ini, const unsigned _id)
+PokeGen::PokeMod::MapTrainerTeam::MapTrainerTeam(const Pokemod *par, Ini &ini, const unsigned _id)
{
LogCtorIni("MapTrainerTeam", _id);
+ pokemod = par;
ImportIni(ini, _id);
if (id == UINT_MAX)
LogIdError("MapTrainerTeam");
@@ -50,17 +50,17 @@ PokeGen::PokeMod::MapTrainerTeam::~MapTrainerTeam() void PokeGen::PokeMod::MapTrainerTeam::Validate()
{
LogValidateStart("MapTrainerTeam", id);
- if (!curPokeMod.GetPokemon(species))
+ if (!pokemod->GetPokemon(species))
{
LogVarNotValid("MapTrainerTeam", id, "species");
isValid = false;
}
- if (curPokeMod.GetMaxLevel() <= level)
+ if (pokemod->GetMaxLevel() <= level)
{
LogOutOfRange("MapTrainerTeam", id, "level", level, GetSpeciesString());
isValid = false;
}
- if (!curPokeMod.GetItem(item))
+ if (!pokemod->GetItem(item))
{
LogVarNotValid("MapTrainerTeam", id, "item");
isValid = false;
@@ -72,19 +72,19 @@ void PokeGen::PokeMod::MapTrainerTeam::Validate() void PokeGen::PokeMod::MapTrainerTeam::Validate(const wxListBox &output)
{
LogValidateStart("MapTrainerTeam", id);
- if (!curPokeMod.GetPokemon(species))
+ if (!pokemod->GetPokemon(species))
{
LogVarNotValid("MapTrainerTeam", id, "species", species);
output.Append(ConsoleLogVarNotValid("MapTrainerTeam", id, "species", species));
isValid = false;
}
- if (curPokeMod.GetMaxLevel() <= level)
+ if (pokemod->GetMaxLevel() <= level)
{
LogVarOutOfRange("MapTrainerTeam", id, "level", level, GetSpeciesString());
output.Append(ConsoleLogVarOutOfRange("MapTrainerTeam", id, "level", level, GetSpeciesString()));
isValid = false;
}
- if (!curPokeMod.GetItem(item))
+ if (!pokemod->GetItem(item))
{
LogVarNotValid("MapTrainerTeam", id, "item", item);
output.Append(ConsoleLogVarNotValid("MapTrainerTeam", id, "item", item));
@@ -126,35 +126,35 @@ void PokeGen::PokeMod::MapTrainerTeam::ExportIni(std::ofstream &fout, const Stri void PokeGen::PokeMod::MapTrainerTeam::SetSpecies(const unsigned s)
{
LogSetVar("MapTrainerTeam", id, "species", s);
- if (curPokeMod.GetPokemon(s))
+ if (pokemod->GetPokemon(s))
species = s;
}
void PokeGen::PokeMod::MapTrainerTeam::SetSpecies(const String &s)
{
LogSetVar("MapTrainerTeam", id, "species string", s);
- if (const Pokemon *p = curPokeMod.GetPokemon(s))
+ if (const Pokemon *p = pokemod->GetPokemon(s))
species = p->GetId();
}
void PokeGen::PokeMod::MapTrainerTeam::SetLevel(const unsigned l)
{
LogSetVar("MapTrainerTeam", id, "level", l, GetSpeciesString());
- if (l <= curPokeMod.GetMaxLevel())
+ if (l <= pokemod->GetMaxLevel())
level = l;
}
void PokeGen::PokeMod::MapTrainerTeam::SetItem(const unsigned i)
{
LogSetVar("MapTrainerTeam", id, "item", i, GetSpeciesString());
- if (curPokeMod.GetItem(i))
+ if (pokemod->GetItem(i))
item = i;
}
void PokeGen::PokeMod::MapTrainerTeam::SetItem(const String &i)
{
LogSetVar("MapTrainerTeam", id, "item string", i, GetSpeciesString());
- if (const Item *temp = curPokeMod.GetItem(i))
+ if (const Item *temp = pokemod->GetItem(i))
item = temp->GetId();
}
@@ -167,7 +167,7 @@ unsigned PokeGen::PokeMod::MapTrainerTeam::GetSpecies() const PokeGen::PokeMod::String PokeGen::PokeMod::MapTrainerTeam::GetSpeciesString() const
{
LogFetchVar("MapTrainerTeam", id, "species string", species);
- if (const Pokemon *p = curPokeMod.GetPokemon(species))
+ if (const Pokemon *p = pokemod->GetPokemon(species))
return p->GetName();
return "";
}
@@ -187,7 +187,7 @@ unsigned PokeGen::PokeMod::MapTrainerTeam::GetItem() const PokeGen::PokeMod::String PokeGen::PokeMod::MapTrainerTeam::GetItemString() const
{
LogFetchVar("MapTrainerTeam", id, "item string", item, GetSpeciesString());
- if (const Item *i = curPokeMod.GetItem(item))
+ if (const Item *i = pokemod->GetItem(item))
i->GetName();
return "";
}
|
