summaryrefslogtreecommitdiffstats
path: root/pokemod/Ability.cpp
diff options
context:
space:
mode:
authorBen Boeckel <MathStuf@gmail.com>2007-05-03 23:12:56 +0000
committerBen Boeckel <MathStuf@gmail.com>2007-05-03 23:12:56 +0000
commit21cb50c82f18b3a2ee1e77a7de11413ce45e6587 (patch)
tree33d1c600c9e26756580c92ea6b331041699510eb /pokemod/Ability.cpp
parent621d0f09fafba69aa650bc1555927f41e9c8e60e (diff)
downloadsigen-21cb50c82f18b3a2ee1e77a7de11413ce45e6587.tar.gz
sigen-21cb50c82f18b3a2ee1e77a7de11413ce45e6587.tar.xz
sigen-21cb50c82f18b3a2ee1e77a7de11413ce45e6587.zip
git-svn-id: https://pokegen.svn.sourceforge.net/svnroot/pokegen/trunk@7 6ecfd1a5-f3ed-3746-8530-beee90d26b22
Diffstat (limited to 'pokemod/Ability.cpp')
-rw-r--r--pokemod/Ability.cpp40
1 files changed, 32 insertions, 8 deletions
diff --git a/pokemod/Ability.cpp b/pokemod/Ability.cpp
index 1974f487..1ca90255 100644
--- a/pokemod/Ability.cpp
+++ b/pokemod/Ability.cpp
@@ -45,11 +45,7 @@ PokeGen::PokeMod::Ability::~Ability()
LogDtor("Ability", id, name));
}
-#ifdef POKEMODR
-void PokeGen::PokeMod::Ability::Validate(wxListBox &output)
-#else
void PokeGen::PokeMod::Ability::Validate()
-#endif
{
isValid = true;
LogValidateStart("Ability", id, name);
@@ -57,9 +53,38 @@ void PokeGen::PokeMod::Ability::Validate()
if (name == "")
{
LogVarNotSet("Ability", "Name", id, name);
-# ifdef POKEMODR
+ isValid = false;
+ }
+ // Check if there are any effects defined
+ if (GetAbilityEffectCount())
+ {
+ // Validate each effect
+ for (std::vector<AbilityEffect>::iterator i = effects.begin(); i != effects.end(); ++i)
+ {
+ LogSubmoduleIterate("Ability", "effect", i->GetId(), id, name);
+ // If an effect isn't valid, neither is the ability
+ if (!i->IsValid())
+ isValid = false;
+ }
+ }
+ else
+ {
+ LogSubmoduleEmpty("Ability", "effect", id, name);
+ isValid = false;
+ }
+ LogValidationOver("Ability", isValid, id, name);
+}
+
+#ifdef PG_DEBUG_WINDOW
+void PokeGen::PokeMod::Ability::Validate(wxListBox &output)
+{
+ isValid = true;
+ LogValidateStart("Ability", id, name);
+ // Make sure the name is set to something
+ if (name == "")
+ {
+ LogVarNotSet("Ability", "Name", id, name);
output.Append(ConsoleLogVarNotSet("Ability", "Name", id, name));
-# endif
isValid = false;
}
// Check if there are any effects defined
@@ -77,13 +102,12 @@ void PokeGen::PokeMod::Ability::Validate()
else
{
LogSubmoduleEmpty("Ability", "effect", id, name);
-# ifdef POKEMODR
output.Append(ConsoleLogSubmoduleEmpty("Ability", "effect", id, name));
-# endif
isValid = false;
}
LogValidationOver("Ability", isValid, id, name);
}
+#endif
void PokeGen::PokeMod::Ability::ImportXml(XmlElement &xml, unsigned _id)
{