diff options
| author | Ben Boeckel <MathStuf@gmail.com> | 2008-06-19 02:06:10 +0000 |
|---|---|---|
| committer | Ben Boeckel <MathStuf@gmail.com> | 2008-06-19 02:06:10 +0000 |
| commit | 6dd3d36c4552565756dcedab2ddd44e90a553252 (patch) | |
| tree | 85fce9e5b97bd3a5f9f60b8d427ca8155d76609f /pokemod/Rules.cpp | |
| parent | 5d7d71ddb75f636f94028da346f43565ffb798df (diff) | |
| download | sigen-6dd3d36c4552565756dcedab2ddd44e90a553252.tar.gz sigen-6dd3d36c4552565756dcedab2ddd44e90a553252.tar.xz sigen-6dd3d36c4552565756dcedab2ddd44e90a553252.zip | |
[FIX] Validation works in Pokémodr
[FIX] Macros moved to their own file
[FIX] Macros for subclasses added
[FIX] Key shortcuts added to context menu items
[FIX] Rules had a redundant field
git-svn-id: https://pokegen.svn.sourceforge.net/svnroot/pokegen/trunk@212 6ecfd1a5-f3ed-3746-8530-beee90d26b22
Diffstat (limited to 'pokemod/Rules.cpp')
| -rw-r--r-- | pokemod/Rules.cpp | 23 |
1 files changed, 3 insertions, 20 deletions
diff --git a/pokemod/Rules.cpp b/pokemod/Rules.cpp index 38bfe6ef..225679ac 100644 --- a/pokemod/Rules.cpp +++ b/pokemod/Rules.cpp @@ -19,6 +19,7 @@ #include "Rules.h" // Pokemod includes +#include "Macros.h" #include "Pokemod.h" const QStringList Pokemod::Rules::DVStr = QStringList() << "16" << "32"; @@ -34,7 +35,6 @@ Pokemod::Rules::Rules(const Pokemod* parent) : m_genderAllowed(false), m_breedingAllowed(false), m_criticalDomains(false), - m_maxMultiplier(1), m_numBoxes(0), m_boxSize(1), m_maxParty(1), @@ -76,8 +76,8 @@ Pokemod::Rules::Rules(const QDomElement& xml, const Pokemod* parent) : void Pokemod::Rules::validate() { + TEST_BEGIN(); TEST(setBreedingAllowed, breedingAllowed); - TEST(setMaxMultiplier, maxMultiplier); TEST(setNumBoxes, numBoxes); TEST(setBoxSize, boxSize); TEST(setMaxParty, maxParty); @@ -94,6 +94,7 @@ void Pokemod::Rules::validate() TEST(setPokerusChance, pokerusChance); if (.005 < m_pokerusChance) emit(warning("Pokerus chance is high")); + TEST_END(); } void Pokemod::Rules::load(const QDomElement& xml, const int /*id*/) @@ -101,7 +102,6 @@ void Pokemod::Rules::load(const QDomElement& xml, const int /*id*/) LOAD(bool, genderAllowed); LOAD(bool, breedingAllowed); LOAD(bool, criticalDomains); - LOAD(int, maxMultiplier); LOAD(int, numBoxes); LOAD(int, boxSize); LOAD(int, maxParty); @@ -134,7 +134,6 @@ QDomElement Pokemod::Rules::save() const SAVE(bool, genderAllowed); SAVE(bool, breedingAllowed); SAVE(bool, criticalDomains); - SAVE(int, maxMultiplier); SAVE(int, numBoxes); SAVE(int, boxSize); SAVE(int, maxParty); @@ -182,16 +181,6 @@ void Pokemod::Rules::setCriticalDomains(const bool criticalDomains) CHECK(criticalDomains); } -void Pokemod::Rules::setMaxMultiplier(const int maxMultiplier) -{ - if (!maxMultiplier) - { - emit(error(bounds("maxMultiplier"))); - return; - } - CHECK(maxMultiplier); -} - void Pokemod::Rules::setNumBoxes(const int numBoxes) { CHECK(numBoxes); @@ -377,11 +366,6 @@ bool Pokemod::Rules::criticalDomains() const return m_criticalDomains; } -int Pokemod::Rules::maxMultiplier() const -{ - return m_maxMultiplier; -} - int Pokemod::Rules::numBoxes() const { return m_numBoxes; @@ -509,7 +493,6 @@ Pokemod::Rules& Pokemod::Rules::operator=(const Rules& rhs) COPY(genderAllowed); COPY(breedingAllowed); COPY(criticalDomains); - COPY(maxMultiplier); COPY(numBoxes); COPY(boxSize); COPY(maxParty); |
