diff options
Diffstat (limited to 'pokemod/Nature.cpp')
| -rw-r--r-- | pokemod/Nature.cpp | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/pokemod/Nature.cpp b/pokemod/Nature.cpp index bc30c80b..e36efb61 100644 --- a/pokemod/Nature.cpp +++ b/pokemod/Nature.cpp @@ -22,65 +22,65 @@ #include "Pokemod.h" #include "Rules.h" -Nature::Nature(const Nature& nature) : +Pokemod::Nature::Nature(const Nature& nature) : Object("Nature", nature.parent(), nature.id()) { *this = nature; } -Nature::Nature(const Pokemod* parent, const int id) : +Pokemod::Nature::Nature(const Pokemod* parent, const int id) : Object("Nature", parent, id), m_name(""), m_weight(1) { - for (int i = 0; i < Pokemod::ST_End_GSC; ++i) + for (int i = 0; i < ST_End_GSC; ++i) m_stat[i].set(1, 1); } -Nature::Nature(const Nature& nature, const Pokemod* parent, const int id) : +Pokemod::Nature::Nature(const Nature& nature, const Pokemod* parent, const int id) : Object("Nature", parent, id) { *this = nature; } -Nature::Nature(const QDomElement& xml, const Pokemod* parent, const int id) : +Pokemod::Nature::Nature(const QDomElement& xml, const Pokemod* parent, const int id) : Object("Nature", parent, id) { load(xml, id); } -void Nature::validate() +void Pokemod::Nature::validate() { if (m_name.isEmpty()) emit(error("Name is empty")); TEST(setWeight, weight); } -void Nature::load(const QDomElement& xml, int id) +void Pokemod::Nature::load(const QDomElement& xml, int id) { LOAD_ID(); LOAD(QString, name); - LOAD_ARRAY(Fraction, stat, Pokemod::ST_End_GSC); + LOAD_ARRAY(Fraction, stat, ST_End_GSC); LOAD(int, weight); } -QDomElement Nature::save() const +QDomElement Pokemod::Nature::save() const { SAVE_CREATE(); SAVE(QString, name); - SAVE_ARRAY(Fraction, stat, Pokemod::ST_End_GSC); + SAVE_ARRAY(Fraction, stat, ST_End_GSC); SAVE(int, weight); return xml; } -void Nature::setName(const QString& name) +void Pokemod::Nature::setName(const QString& name) { CHECK(name); } -void Nature::setStat(const int stat, const Fraction& multiplier) +void Pokemod::Nature::setStat(const int stat, const Fraction& multiplier) { - if ((static_cast<const Pokemod*>(pokemod())->rules()->specialSplit() ? Pokemod::ST_End_GSC : Pokemod::ST_End_RBY) <= stat) + if ((static_cast<const Pokemod*>(pokemod())->rules()->specialSplit() ? ST_End_GSC : ST_End_RBY) <= stat) { emit(error(bounds("stat"))); return; @@ -88,7 +88,7 @@ void Nature::setStat(const int stat, const Fraction& multiplier) CHECK_ARRAY(stat[stat], multiplier); } -void Nature::setWeight(const int weight) +void Pokemod::Nature::setWeight(const int weight) { if (!weight) { @@ -98,14 +98,14 @@ void Nature::setWeight(const int weight) CHECK(weight); } -QString Nature::name() const +QString Pokemod::Nature::name() const { return m_name; } -Fraction Nature::stat(const int stat) const +Pokemod::Fraction Pokemod::Nature::stat(const int stat) const { - if (Pokemod::ST_End_GSC <= stat) + if (ST_End_GSC <= stat) { emit(warning(bounds("stat"))); return Fraction(); @@ -113,17 +113,17 @@ Fraction Nature::stat(const int stat) const return m_stat[stat]; } -int Nature::weight() const +int Pokemod::Nature::weight() const { return m_weight; } -Nature& Nature::operator=(const Nature& rhs) +Pokemod::Nature& Pokemod::Nature::operator=(const Nature& rhs) { if (this == &rhs) return *this; COPY(name); - COPY_ARRAY(stat, Pokemod::ST_End_GSC); + COPY_ARRAY(stat, ST_End_GSC); COPY(weight); return *this; } |
