diff options
| author | Ben Boeckel <MathStuf@gmail.com> | 2008-04-17 23:34:36 +0000 |
|---|---|---|
| committer | Ben Boeckel <MathStuf@gmail.com> | 2008-04-17 23:34:36 +0000 |
| commit | 6679f5cffa9d35a23b76605ddfbf3257f882b6ee (patch) | |
| tree | c8e41854a60b64e8569939bca6b827807175ef9a /pokemod/Nature.cpp | |
| parent | 05980e883719b1c8ebde1bd2fcbf4f8c16df7ad6 (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/Nature.cpp')
| -rw-r--r-- | pokemod/Nature.cpp | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/pokemod/Nature.cpp b/pokemod/Nature.cpp index 73164b20..7f84286e 100644 --- a/pokemod/Nature.cpp +++ b/pokemod/Nature.cpp @@ -21,22 +21,28 @@ // Header include #include "Nature.h" +Nature::Nature(const Nature& nature) : + Object("Nature", nature.pokemod(), nature.id()) +{ + *this = nature; +} + Nature::Nature(const Pokemod* pokemod, const int id) : Object("Nature", pokemod, id), m_name(""), m_weight(1) { for (int i = 0; i < Pokemod::ST_End_GSC; ++i) - m_stat[i].set(1, 1);//, Frac::Improper); + m_stat[i].set(1, 1);//, Fraction::Improper); } -Nature::Nature(const Pokemod* pokemod, const Nature& nature, const int id) : +Nature::Nature(const Nature& nature, const Pokemod* pokemod, const int id) : Object("Nature", pokemod, id) { *this = nature; } -Nature::Nature(const Pokemod* pokemod, const QDomElement& xml, const int id) : +Nature::Nature(const QDomElement& xml, const Pokemod* pokemod, const int id) : Object("Nature", pokemod, id) { load(xml, id); @@ -63,7 +69,7 @@ void Nature::load(const QDomElement& xml, int id) { LOAD_ID(); LOAD(QString, name); - LOAD_ARRAY(Frac, stat, Pokemod::ST_End_GSC); + LOAD_ARRAY(Fraction, stat, Pokemod::ST_End_GSC); LOAD(int, weight); } @@ -71,7 +77,7 @@ QDomElement Nature::save() const { SAVE_CREATE(); SAVE(QString, name); - SAVE_ARRAY(Frac, stat, Pokemod::ST_End_GSC); + SAVE_ARRAY(Fraction, stat, Pokemod::ST_End_GSC); SAVE(int, weight); return xml; } @@ -81,7 +87,7 @@ void Nature::setName(const QString& name) m_name = name; } -void Nature::setStat(const int stat, const Frac& multiplier) throw(Exception) +void Nature::setStat(const int stat, const Fraction& multiplier) throw(Exception) { if ((pokemod()->rules()->specialSplit() ? Pokemod::ST_End_GSC : Pokemod::ST_End_RBY) <= stat) throw(BoundsException(className(), "stat")); @@ -100,7 +106,7 @@ QString Nature::name() const return m_name; } -Frac Nature::stat(const int stat) const throw(BoundsException) +Fraction Nature::stat(const int stat) const throw(BoundsException) { if ((pokemod()->rules()->specialSplit() ? Pokemod::ST_End_GSC : Pokemod::ST_End_RBY) <= stat) throw(BoundsException(className(), "stat")); |
