diff options
| author | Ben Boeckel <MathStuf@gmail.com> | 2007-05-03 23:12:56 +0000 |
|---|---|---|
| committer | Ben Boeckel <MathStuf@gmail.com> | 2007-05-03 23:12:56 +0000 |
| commit | 21cb50c82f18b3a2ee1e77a7de11413ce45e6587 (patch) | |
| tree | 33d1c600c9e26756580c92ea6b331041699510eb /pokemod/Nature.cpp | |
| parent | 621d0f09fafba69aa650bc1555927f41e9c8e60e (diff) | |
git-svn-id: https://pokegen.svn.sourceforge.net/svnroot/pokegen/trunk@7 6ecfd1a5-f3ed-3746-8530-beee90d26b22
Diffstat (limited to 'pokemod/Nature.cpp')
| -rw-r--r-- | pokemod/Nature.cpp | 36 |
1 files changed, 28 insertions, 8 deletions
diff --git a/pokemod/Nature.cpp b/pokemod/Nature.cpp index 128651ce..ed4aa73a 100644 --- a/pokemod/Nature.cpp +++ b/pokemod/Nature.cpp @@ -44,20 +44,41 @@ PokeGen::PokeMod::Nature::~Nature() LogDtor("Nature", id, name);
}
-#ifdef POKEMODR
-void PokeGen::PokeMod::Nature::Validate(wxListBox &output)
-#else
void PokeGen::PokeMod::Nature::Validate()
-#endif
{
isValid = true;
LogValidateStart("Nature", id, name);
if (name == "")
{
LogVarNotSet("Nature", "name", id);
-# ifdef POKEMODR
+ isValid = false;
+ }
+ if (GetNatureEffectCount())
+ {
+ for (unsigned i = 0; i < GetNatureEffectCount(); ++i)
+ {
+ LogSubmoduleIterate("Nature", "effect", i, id, name);
+ if (!effects[i].IsValid())
+ isValid = false;
+ }
+ }
+ else
+ {
+ LogSubmoduleEmpty("Nature", "effects", id, name);
+ isValid = false;
+ }
+ LogValidationOver("Nature", isValid, id, name);
+}
+
+#ifdef PG_DEBUG_WINDOW
+void PokeGen::PokeMod::Nature::Validate(wxListBox &output)
+{
+ isValid = true;
+ LogValidateStart("Nature", id, name);
+ if (name == "")
+ {
+ LogVarNotSet("Nature", "name", id);
output.Append(ConsoleLogVarNotSet("Nature", "name", id);
-# endif
isValid = false;
}
if (GetNatureEffectCount())
@@ -72,13 +93,12 @@ void PokeGen::PokeMod::Nature::Validate() else
{
LogSubmoduleEmpty("Nature", "effects", id, name);
-# ifdef POKEMODR
output.Append(ConsoleLogSubmoduleEmpty("Nature", "effects", id, name));
-# endif
isValid = false;
}
LogValidationOver("Nature", isValid, id, name);
}
+#endif
void PokeGen::PokeMod::Nature::ImportXml(XmlElement &xml, unsigned _id)
{
|
