summaryrefslogtreecommitdiffstats
path: root/pokemod/Rules.cpp
diff options
context:
space:
mode:
authorBen Boeckel <MathStuf@gmail.com>2008-06-02 01:50:47 +0000
committerBen Boeckel <MathStuf@gmail.com>2008-06-02 01:50:47 +0000
commit87bc8b43600937a3d83cbdf8345e23a484755e3a (patch)
tree661131614ed841f68ab8cc23ea372983d49fbe20 /pokemod/Rules.cpp
parentf3e081acd87439efadd5ff4181916e06cc07f051 (diff)
downloadsigen-87bc8b43600937a3d83cbdf8345e23a484755e3a.tar.gz
sigen-87bc8b43600937a3d83cbdf8345e23a484755e3a.tar.xz
sigen-87bc8b43600937a3d83cbdf8345e23a484755e3a.zip
[FIX] Modified Rules a bit
[FIX] Updated Rules widget to match up with Rules [FIX] Reorganized the Rules widget [FIX] Using KStandardDirs rather than hardcoded ones [FIX] Cleaned up some minor things with KListWidgets git-svn-id: https://pokegen.svn.sourceforge.net/svnroot/pokegen/trunk@188 6ecfd1a5-f3ed-3746-8530-beee90d26b22
Diffstat (limited to 'pokemod/Rules.cpp')
-rw-r--r--pokemod/Rules.cpp108
1 files changed, 71 insertions, 37 deletions
diff --git a/pokemod/Rules.cpp b/pokemod/Rules.cpp
index 22988f40..21f2b428 100644
--- a/pokemod/Rules.cpp
+++ b/pokemod/Rules.cpp
@@ -33,17 +33,19 @@ Rules::Rules(const Pokemod* parent) :
Object("Rules", parent, 0),
m_genderAllowed(false),
m_breedingAllowed(false),
- m_holdItems(0),
m_criticalDomains(false),
- m_abilityAllowed(false),
- m_natureAllowed(false),
+ m_maxMultiplier(1),
m_numBoxes(0),
m_boxSize(1),
m_maxParty(1),
m_maxFight(1),
m_maxPlayers(2),
+ m_maxHeldItems(0),
+ m_maxAbilities(0),
+ m_maxNatures(0),
m_maxMoves(1),
m_maxLevel(1),
+ m_maxStages(6),
m_maxMoney(0),
m_hardCash(false),
m_allowSwitchStyle(false),
@@ -76,6 +78,7 @@ Rules::Rules(const QDomElement& xml, const Pokemod* parent) :
void Rules::validate()
{
TEST(setBreedingAllowed, breedingAllowed);
+ TEST(setMaxMultiplier, maxMultiplier);
TEST(setNumBoxes, numBoxes);
TEST(setBoxSize, boxSize);
TEST(setMaxParty, maxParty);
@@ -99,17 +102,19 @@ void Rules::load(const QDomElement& xml, const int /*id*/)
{
LOAD(bool, genderAllowed);
LOAD(bool, breedingAllowed);
- LOAD(int, holdItems);
LOAD(bool, criticalDomains);
- LOAD(bool, abilityAllowed);
- LOAD(bool, natureAllowed);
+ LOAD(int, maxMultiplier);
LOAD(int, numBoxes);
LOAD(int, boxSize);
LOAD(int, maxParty);
LOAD(int, maxFight);
LOAD(int, maxPlayers);
+ LOAD(int, maxHeldItems);
+ LOAD(int, maxAbilities);
+ LOAD(int, maxNatures);
LOAD(int, maxMoves);
LOAD(int, maxLevel);
+ LOAD(int, maxStages);
LOAD(int, maxMoney);
LOAD(bool, hardCash);
LOAD(bool, allowSwitchStyle);
@@ -131,17 +136,19 @@ QDomElement Rules::save() const
QDomElement xml = QDomDocument().createElement(className());
SAVE(bool, genderAllowed);
SAVE(bool, breedingAllowed);
- SAVE(int, holdItems);
SAVE(bool, criticalDomains);
- SAVE(bool, abilityAllowed);
- SAVE(bool, natureAllowed);
+ SAVE(int, maxMultiplier);
SAVE(int, numBoxes);
SAVE(int, boxSize);
SAVE(int, maxParty);
SAVE(int, maxFight);
SAVE(int, maxPlayers);
+ SAVE(int, maxHeldItems);
+ SAVE(int, maxAbilities);
+ SAVE(int, maxNatures);
SAVE(int, maxMoves);
SAVE(int, maxLevel);
+ SAVE(int, maxStages);
SAVE(int, maxMoney);
SAVE(bool, hardCash);
SAVE(bool, allowSwitchStyle);
@@ -174,24 +181,19 @@ void Rules::setBreedingAllowed(const bool breedingAllowed)
CHECK(breedingAllowed);
}
-void Rules::setHoldItems(const int holdItems)
-{
- CHECK(holdItems);
-}
-
void Rules::setCriticalDomains(const bool criticalDomains)
{
CHECK(criticalDomains);
}
-void Rules::setAbilityAllowed(const bool abilityAllowed)
-{
- CHECK(abilityAllowed);
-}
-
-void Rules::setNatureAllowed(const bool natureAllowed)
+void Rules::setMaxMultiplier(const int maxMultiplier)
{
- CHECK(natureAllowed);
+ if (!maxMultiplier)
+ {
+ emit(error(bounds("maxMultiplier")));
+ return;
+ }
+ CHECK(maxMultiplier);
}
void Rules::setNumBoxes(const int numBoxes)
@@ -231,7 +233,7 @@ void Rules::setMaxFight(const int maxFight)
void Rules::setMaxPlayers(const int maxPlayers)
{
- if (!maxPlayers)
+ if (maxPlayers < 2)
{
emit(error(bounds("maxPlayers")));
return;
@@ -239,6 +241,21 @@ void Rules::setMaxPlayers(const int maxPlayers)
CHECK(maxPlayers);
}
+void Rules::setMaxHeldItems(const int maxHeldItems)
+{
+ CHECK(maxHeldItems);
+}
+
+void Rules::setMaxAbilities(const int maxAbilities)
+{
+ CHECK(maxAbilities);
+}
+
+void Rules::setMaxNatures(const int maxNatures)
+{
+ CHECK(maxNatures);
+}
+
void Rules::setMaxMoves(const int maxMoves)
{
if (!maxMoves)
@@ -259,6 +276,11 @@ void Rules::setMaxLevel(const int maxLevel)
CHECK(maxLevel);
}
+void Rules::setMaxStages(const int maxStages)
+{
+ CHECK(maxStages);
+}
+
void Rules::setMaxMoney(const int maxMoney)
{
CHECK(maxMoney);
@@ -364,24 +386,14 @@ bool Rules::breedingAllowed() const
return m_breedingAllowed;
}
-int Rules::holdItems() const
-{
- return m_holdItems;
-}
-
bool Rules::criticalDomains() const
{
return m_criticalDomains;
}
-bool Rules::abilityAllowed() const
-{
- return m_abilityAllowed;
-}
-
-bool Rules::natureAllowed() const
+int Rules::maxMultiplier() const
{
- return m_natureAllowed;
+ return m_maxMultiplier;
}
int Rules::numBoxes() const
@@ -409,6 +421,21 @@ int Rules::maxPlayers() const
return m_maxPlayers;
}
+int Rules::maxHeldItems() const
+{
+ return m_maxHeldItems;
+}
+
+int Rules::maxAbilities() const
+{
+ return m_maxAbilities;
+}
+
+int Rules::maxNatures() const
+{
+ return m_maxNatures;
+}
+
int Rules::maxMoves() const
{
return m_maxMoves;
@@ -419,6 +446,11 @@ int Rules::maxLevel() const
return m_maxLevel;
}
+int Rules::maxStages() const
+{
+ return m_maxStages;
+}
+
int Rules::maxMoney() const
{
return m_maxMoney;
@@ -495,17 +527,19 @@ Rules& Rules::operator=(const Rules& rhs)
return *this;
COPY(genderAllowed);
COPY(breedingAllowed);
- COPY(holdItems);
COPY(criticalDomains);
- COPY(abilityAllowed);
- COPY(natureAllowed);
+ COPY(maxMultiplier);
COPY(numBoxes);
COPY(boxSize);
COPY(maxParty);
COPY(maxFight);
COPY(maxPlayers);
+ COPY(maxHeldItems);
+ COPY(maxAbilities);
+ COPY(maxNatures);
COPY(maxMoves);
COPY(maxLevel);
+ COPY(maxStages);
COPY(maxMoney);
COPY(hardCash);
COPY(allowSwitchStyle);