summaryrefslogtreecommitdiffstats
path: root/pokemod/PokemonMove.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/PokemonMove.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/PokemonMove.cpp')
-rw-r--r--pokemod/PokemonMove.cpp36
1 files changed, 18 insertions, 18 deletions
diff --git a/pokemod/PokemonMove.cpp b/pokemod/PokemonMove.cpp
index e3d0df75..032c65a5 100644
--- a/pokemod/PokemonMove.cpp
+++ b/pokemod/PokemonMove.cpp
@@ -23,20 +23,20 @@
#include "PokemonMove.h"
-extern PokeGen::PokeMod::Pokemod curPokeMod;
-
-PokeGen::PokeMod::PokemonMove::PokemonMove(const unsigned _id) :
- move(UINT_MAX),
- level(0),
- wild(0)
+PokeGen::PokeMod::PokemonMove::PokemonMove(const Pokemod *par, const unsigned _id) :
+ move(UINT_MAX),
+ level(0),
+ wild(0)
{
LogCtor("PokemonMove", _id);
id = _id;
+ pokemod = par;
}
-PokeGen::PokeMod::PokemonMove::PokemonMove(Ini &ini, const unsigned _id)
+PokeGen::PokeMod::PokemonMove::PokemonMove(const Pokemod *par, Ini &ini, const unsigned _id)
{
LogCtorIni("PokemonMove", _id);
+ pokemod = par;
ImportIni(ini, _id);
if (id == UINT_MAX)
LogIdError("PokemonMove");
@@ -50,17 +50,17 @@ PokeGen::PokeMod::PokemonMove::~PokemonMove()
void PokeGen::PokeMod::PokemonMove::Validate()
{
LogValidateStart("PokemonMove", id, GetMoveString());
- if (!curPokeMod.GetMove(move))
+ if (!pokemod->GetMove(move))
{
LogVarNotValid("PokemonMove", id, "move");
isValid = false;
}
- if (level < curPokeMod.GetMaxLevel())
+ if (level < pokemod->GetMaxLevel())
{
LogVarNotValid("PokemonMove", id, "level", GetMoveString());
isValid = false;
}
- if (wild < curPokeMod.GetMaxLevel())
+ if (wild < pokemod->GetMaxLevel())
{
LogVarNotValid("PokemonMove", id, "wild", GetMoveString());
isValid = false;
@@ -72,19 +72,19 @@ void PokeGen::PokeMod::PokemonMove::Validate()
void PokeGen::PokeMod::PokemonMove::Validate(const wxListBox &output)
{
LogValidateStart("PokemonMove", id, GetMoveString());
- if (!curPokeMod.GetMove(move))
+ if (!pokemod->GetMove(move))
{
LogVarNotValid("PokemonMove", id, "move");
output.Append(ConsoleLogVarNotValid("PokemonMove", id, "move"));
isValid = false;
}
- if (level < curPokeMod.GetMaxLevel())
+ if (level < pokemod->GetMaxLevel())
{
LogVarNotValid("PokemonMove", id, "level", GetMoveString());
output.Append(ConsoleLogVarNotValid("PokemonMove", id, "level", GetMoveString()));
isValid = false;
}
- if (wild < curPokeMod.GetMaxLevel())
+ if (wild < pokemod->GetMaxLevel())
{
LogVarNotValid("PokemonMove", id, "wild", GetMoveString());
output.Append(ConsoleLogVarNotValid("PokemonMove", id, "wild", GetMoveString()));
@@ -126,28 +126,28 @@ void PokeGen::PokeMod::PokemonMove::ExportIni(std::ofstream &fout, const String
void PokeGen::PokeMod::PokemonMove::SetMove(const unsigned m)
{
LogSetVar("PokemonMove", id, "move", m);
- if (curPokeMod.GetMove(m))
+ if (pokemod->GetMove(m))
move = m;
}
void PokeGen::PokeMod::PokemonMove::SetMove(const String &m)
{
LogSetVar("PokemonMove", id, "move", m);
- if (const Move *temp = curPokeMod.GetMove(m))
+ if (const Move *temp = pokemod->GetMove(m))
move = temp->GetId();
}
void PokeGen::PokeMod::PokemonMove::SetLevel(const unsigned l)
{
LogSetVar("PokemonMove", id, "level", l, GetMoveString());
- if (l < curPokeMod.GetMaxLevel())
+ if (l < pokemod->GetMaxLevel())
level = l;
}
void PokeGen::PokeMod::PokemonMove::SetWild(const unsigned w)
{
LogSetVar("PokemonMove", id, "wild", w, GetMoveString());
- if (w < curPokeMod.GetMaxLevel())
+ if (w < pokemod->GetMaxLevel())
wild = w;
}
@@ -160,7 +160,7 @@ unsigned PokeGen::PokeMod::PokemonMove::GetMove() const
PokeGen::PokeMod::String PokeGen::PokeMod::PokemonMove::GetMoveString() const
{
LogFetchVar("PokemonMove", id, "move string", move);
- if (const Move *m = curPokeMod.GetMove(move))
+ if (const Move *m = pokemod->GetMove(move))
m->GetName();
return "";
}