summaryrefslogtreecommitdiffstats
path: root/pokemod/Nature.cpp
diff options
context:
space:
mode:
authorBen Boeckel <MathStuf@gmail.com>2008-06-09 00:50:59 +0000
committerBen Boeckel <MathStuf@gmail.com>2008-06-09 00:50:59 +0000
commit60a2ed8ee8aa994c83d382af2ec477e171beb950 (patch)
tree6fea6867adee00f22b9d775a6dce15ed875d75e6 /pokemod/Nature.cpp
parent0737b455ca94351c574aa1a8c83ea30c5b7bc443 (diff)
downloadsigen-60a2ed8ee8aa994c83d382af2ec477e171beb950.tar.gz
sigen-60a2ed8ee8aa994c83d382af2ec477e171beb950.tar.xz
sigen-60a2ed8ee8aa994c83d382af2ec477e171beb950.zip
[FIX] All modules now use their own namespace
git-svn-id: https://pokegen.svn.sourceforge.net/svnroot/pokegen/trunk@201 6ecfd1a5-f3ed-3746-8530-beee90d26b22
Diffstat (limited to 'pokemod/Nature.cpp')
-rw-r--r--pokemod/Nature.cpp40
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;
}