summaryrefslogtreecommitdiffstats
path: root/pokemod/Rules.cpp
diff options
context:
space:
mode:
authorBen Boeckel <MathStuf@gmail.com>2008-04-17 23:34:36 +0000
committerBen Boeckel <MathStuf@gmail.com>2008-04-17 23:34:36 +0000
commit6679f5cffa9d35a23b76605ddfbf3257f882b6ee (patch)
treec8e41854a60b64e8569939bca6b827807175ef9a /pokemod/Rules.cpp
parent05980e883719b1c8ebde1bd2fcbf4f8c16df7ad6 (diff)
[FIX] Frac -> Fraction
[FIX] ImageCache and Ini removed [FIX] Fraction/Point widgets moved to pokemodr [FIX] Copy ctors made for pokemod classes [FIX] Ctors in pokemod fixed [FIX] Copyright headers fixed in pokemodr [FIX] PokeModr updated to new API and fixed in some places git-svn-id: https://pokegen.svn.sourceforge.net/svnroot/pokegen/trunk@99 6ecfd1a5-f3ed-3746-8530-beee90d26b22
Diffstat (limited to 'pokemod/Rules.cpp')
-rw-r--r--pokemod/Rules.cpp20
1 files changed, 13 insertions, 7 deletions
diff --git a/pokemod/Rules.cpp b/pokemod/Rules.cpp
index 89288b5c..dfc940c9 100644
--- a/pokemod/Rules.cpp
+++ b/pokemod/Rules.cpp
@@ -23,6 +23,12 @@
const QStringList Rules::DVStr = QStringList() << "16" << "32";
+Rules::Rules(const Rules& rules) :
+ Object("Rules", rules.pokemod(), 0)
+{
+ *this = rules;
+}
+
Rules::Rules(const Pokemod* pokemod) :
Object("Rules", pokemod, 0),
m_genderAllowed(false),
@@ -54,13 +60,13 @@ Rules::Rules(const Pokemod* pokemod) :
{
}
-Rules::Rules(const Pokemod* pokemod, const Rules& rules) :
+Rules::Rules(const Rules& rules, const Pokemod* pokemod) :
Object("Rules", pokemod, 0)
{
*this = rules;
}
-Rules::Rules(const Pokemod* pokemod, const QDomElement& xml) :
+Rules::Rules(const QDomElement& xml, const Pokemod* pokemod) :
Object("Rules", pokemod, 0)
{
load(xml);
@@ -145,7 +151,7 @@ void Rules::load(const QDomElement& xml, const int) throw(Exception)
LOAD(bool, effortValuesAllowed);
LOAD(int, maxTotalEV);
LOAD(int, maxEVPerStat);
- LOAD(Frac, pokerusChance);
+ LOAD(Fraction, pokerusChance);
}
QDomElement Rules::save() const
@@ -177,7 +183,7 @@ QDomElement Rules::save() const
SAVE(bool, effortValuesAllowed);
SAVE(int, maxTotalEV);
SAVE(int, maxEVPerStat);
- SAVE(Frac, pokerusChance);
+ SAVE(Fraction, pokerusChance);
return xml;
}
@@ -328,9 +334,9 @@ void Rules::setMaxEVPerStat(const int maxEVPerStat) throw(BoundsException)
m_maxEVPerStat = maxEVPerStat;
}
-void Rules::setPokerusChance(const int numerator, const int denominator) throw(Exception)
+void Rules::setPokerusChance(const Fraction& pokerusChance) throw(Exception)
{
- m_pokerusChance.set(numerator, denominator);
+ m_pokerusChance = pokerusChance;
}
bool Rules::genderAllowed() const
@@ -458,7 +464,7 @@ int Rules::maxEVPerStat() const
return m_maxEVPerStat;
}
-Frac Rules::pokerusChance() const
+Fraction Rules::pokerusChance() const
{
return m_pokerusChance;
}