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/MapWildPokemon.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/MapWildPokemon.cpp')
| -rw-r--r-- | pokemod/MapWildPokemon.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/pokemod/MapWildPokemon.cpp b/pokemod/MapWildPokemon.cpp index cc42f3b4..ef77ad0e 100644 --- a/pokemod/MapWildPokemon.cpp +++ b/pokemod/MapWildPokemon.cpp @@ -23,20 +23,20 @@ #include "MapWildPokemon.h"
-extern PokeGen::PokeMod::Pokemod curPokeMod;
-
-PokeGen::PokeMod::MapWildPokemon::MapWildPokemon(const unsigned _id) :
+PokeGen::PokeMod::MapWildPokemon::MapWildPokemon(const Pokemod *par, const unsigned _id) :
pokemon(UINT_MAX),
level(1),
weight(1)
{
LogCtor("MapWildPokemon", _id);
id = _id;
+ pokemod = par;
}
-PokeGen::PokeMod::MapWildPokemon::MapWildPokemon(Ini &ini, const unsigned _id)
+PokeGen::PokeMod::MapWildPokemon::MapWildPokemon(const Pokemod *par, Ini &ini, const unsigned _id)
{
LogCtorIni("MapWildPokemon", _id);
+ pokemod = par;
ImportIni(ini, _id);
if (id == UINT_MAX)
LogIdError("MapWildPokemon");
@@ -50,12 +50,12 @@ PokeGen::PokeMod::MapWildPokemon::~MapWildPokemon() void PokeGen::PokeMod::MapWildPokemon::Validate()
{
LogValidateStart("MapWildPokemon", id, GetPokemonString());
- if (!curPokeMod.GetPokemon(pokemon))
+ if (!pokemod->GetPokemon(pokemon))
{
LogVarNotValid("MapWildPokemon", id, "pokemon");
isValid = false;
}
- if (!level || (curPokeMod.GetMaxLevel() <= level))
+ if (!level || (pokemod->GetMaxLevel() <= level))
{
LogVarNotValid("MapWildPokemon", id, "level", GetPokemonString());
isValid = false;
@@ -72,13 +72,13 @@ void PokeGen::PokeMod::MapWildPokemon::Validate() void PokeGen::PokeMod::MapWildPokemon::Validate(const wxListBox &output)
{
LogValidateStart("MapWildPokemon", id, GetPokemonString());
- if (!curPokeMod.GetPokemon(pokemon))
+ if (!pokemod->GetPokemon(pokemon))
{
LogVarNotValid("MapWildPokemon", id, "pokemon");
output.Append(ConsoleLogVarNotValid("MapWildPokemon", id, "pokemon"));
isValid = false;
}
- if (curPokeMod.GetMaxLevel() <= level)
+ if (pokemod->GetMaxLevel() <= level)
{
LogVarNotValid("MapWildPokemon", id, "level", GetPokemonString());
output.Append(ConsoleLogVarNotValid("MapWildPokemon", id, "level", GetPokemonString()));
@@ -126,14 +126,14 @@ void PokeGen::PokeMod::MapWildPokemon::ExportIni(std::ofstream &fout, const Stri void PokeGen::PokeMod::MapWildPokemon::SetPokemon(const unsigned p)
{
LogSetVar("MapWildPokemon", id, "pokemon", p);
- if (curPokeMod.GetPokemon(p))
+ if (pokemod->GetPokemon(p))
pokemon = p;
}
void PokeGen::PokeMod::MapWildPokemon::SetPokemon(const String &p)
{
LogSetVar("MapWildPokemon", id, "pokemon string", p);
- if (const Pokemon *temp = curPokeMod.GetPokemon(p))
+ if (const Pokemon *temp = pokemod->GetPokemon(p))
pokemon = temp->GetId();
}
@@ -159,7 +159,7 @@ unsigned PokeGen::PokeMod::MapWildPokemon::GetPokemon() const PokeGen::PokeMod::String PokeGen::PokeMod::MapWildPokemon::GetPokemonString() const
{
LogFetchVar("MapWildPokemon", id, "pokemon string", pokemon);
- if (const Pokemon *p = curPokeMod.GetPokemon(pokemon))
+ if (const Pokemon *p = pokemod->GetPokemon(pokemon))
return p->GetName();
return "";
}
|
