summaryrefslogtreecommitdiffstats
path: root/pokemod/AbilityEffect.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/AbilityEffect.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/AbilityEffect.cpp')
-rw-r--r--pokemod/AbilityEffect.cpp26
1 files changed, 16 insertions, 10 deletions
diff --git a/pokemod/AbilityEffect.cpp b/pokemod/AbilityEffect.cpp
index 369095d9..40f3368a 100644
--- a/pokemod/AbilityEffect.cpp
+++ b/pokemod/AbilityEffect.cpp
@@ -33,6 +33,12 @@ const QStringList AbilityEffect::BoostStr = QStringList() << "Boost" << "Hinder"
const QStringList AbilityEffect::SideStr = QStringList() << "Above" << "Below";
+AbilityEffect::AbilityEffect(const AbilityEffect& effect) :
+ Object("AbilityEffect", effect.pokemod(), effect.id())
+{
+ *this = effect;
+}
+
AbilityEffect::AbilityEffect(const Pokemod* pokemod, const int id) :
Object("AbilityEffect", pokemod, id),
m_chance(1, 1),
@@ -46,13 +52,13 @@ AbilityEffect::AbilityEffect(const Pokemod* pokemod, const int id) :
{
}
-AbilityEffect::AbilityEffect(const Pokemod* pokemod, const AbilityEffect& effect, const int id) :
+AbilityEffect::AbilityEffect(const AbilityEffect& effect, const Pokemod* pokemod, const int id) :
Object("AbilityEffect", pokemod, id)
{
*this = effect;
}
-AbilityEffect::AbilityEffect(const Pokemod* pokemod, const QDomElement& xml, const int id) :
+AbilityEffect::AbilityEffect(const QDomElement& xml, const Pokemod* pokemod, const int id) :
Object("AbilityEffect", pokemod, id)
{
load(xml, id);
@@ -201,31 +207,31 @@ bool AbilityEffect::validate() const
void AbilityEffect::load(const QDomElement& xml, int id)
{
LOAD_ID();
- LOAD(Frac, chance);
+ LOAD(Fraction, chance);
LOAD(int, effect);
LOAD(int, value1);
LOAD(int, value2);
LOAD(int, value3);
LOAD(int, trigger);
LOAD(int, triggerValue1);
- LOAD(Frac, triggerValue2);
+ LOAD(Fraction, triggerValue2);
}
QDomElement AbilityEffect::save() const
{
SAVE_CREATE();
- SAVE(Frac, chance);
+ SAVE(Fraction, chance);
SAVE(int, effect);
SAVE(int, value1);
SAVE(int, value2);
SAVE(int, value3);
SAVE(int, trigger);
SAVE(int, triggerValue1);
- SAVE(Frac, triggerValue2);
+ SAVE(Fraction, triggerValue2);
return xml;
}
-void AbilityEffect::setChance(const Frac& chance) throw(Exception)
+void AbilityEffect::setChance(const Fraction& chance) throw(Exception)
{
m_chance = chance;
}
@@ -373,14 +379,14 @@ void AbilityEffect::setTriggerValue1(const int triggerValue1) throw(Exception)
m_triggerValue1 = triggerValue1;
}
-void AbilityEffect::setTriggerValue2(const Frac& triggerValue2) throw(Exception)
+void AbilityEffect::setTriggerValue2(const Fraction& triggerValue2) throw(Exception)
{
if (m_trigger != T_HPBoundary)
throw(UnusedException(className(), "triggerValue2"));
m_triggerValue2 = triggerValue2;
}
-Frac AbilityEffect::chance() const
+Fraction AbilityEffect::chance() const
{
return m_chance;
}
@@ -415,7 +421,7 @@ int AbilityEffect::triggerValue1() const
return m_triggerValue1;
}
-Frac AbilityEffect::triggerValue2() const
+Fraction AbilityEffect::triggerValue2() const
{
return m_triggerValue2;
}