summaryrefslogtreecommitdiffstats
path: root/pokemod/Badge.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/Badge.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/Badge.cpp')
-rw-r--r--pokemod/Badge.cpp51
1 files changed, 26 insertions, 25 deletions
diff --git a/pokemod/Badge.cpp b/pokemod/Badge.cpp
index 0b747e84..5a580f00 100644
--- a/pokemod/Badge.cpp
+++ b/pokemod/Badge.cpp
@@ -17,77 +17,78 @@
// Header include
#include "Badge.h"
+#include "Pokemod.h"
#include "Rules.h"
// Qt includes
#include <QBuffer>
-Badge::Badge(const Badge& badge) :
+Pokemod::Badge::Badge(const Badge& badge) :
Object("Badge", badge.parent(), badge.id())
{
*this = badge;
}
-Badge::Badge(const Pokemod* parent, const int id) :
+Pokemod::Badge::Badge(const Pokemod* parent, const int id) :
Object("Badge", parent, id),
m_name(""),
m_face(64, 64),
m_badge(64, 64),
m_obey(0)
{
- 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);
}
-Badge::Badge(const Badge& badge, const Pokemod* parent, const int id) :
+Pokemod::Badge::Badge(const Badge& badge, const Pokemod* parent, const int id) :
Object("Badge", parent, id)
{
*this = badge;
}
-Badge::Badge(const QDomElement& xml, const Pokemod* parent, const int id) :
+Pokemod::Badge::Badge(const QDomElement& xml, const Pokemod* parent, const int id) :
Object("Badge", parent, id)
{
load(xml, id);
}
-void Badge::validate()
+void Pokemod::Badge::validate()
{
if (m_name.isEmpty())
emit(error("Name is empty"));
TEST(setFace, face);
TEST(setBadge, badge);
TEST(setObey, obey);
- TEST_ARRAY(setStat, stat, (static_cast<const Pokemod*>(pokemod())->rules()->specialSplit() ? Pokemod::ST_End_GSC : Pokemod::ST_End_RBY));
+ TEST_ARRAY(setStat, stat, (static_cast<const Pokemod*>(pokemod())->rules()->specialSplit() ? ST_End_GSC : ST_End_RBY));
}
-void Badge::load(const QDomElement& xml, int id)
+void Pokemod::Badge::load(const QDomElement& xml, int id)
{
LOAD_ID();
LOAD(QString, name);
LOAD(QPixmap, face);
LOAD(QPixmap, badge);
LOAD(int, obey);
- LOAD_ARRAY(Fraction, stat, (static_cast<const Pokemod*>(pokemod())->rules()->specialSplit() ? Pokemod::ST_End_GSC : Pokemod::ST_End_RBY));
+ LOAD_ARRAY(Fraction, stat, (static_cast<const Pokemod*>(pokemod())->rules()->specialSplit() ? ST_End_GSC : ST_End_RBY));
}
-QDomElement Badge::save() const
+QDomElement Pokemod::Badge::save() const
{
SAVE_CREATE();
SAVE(QString, name);
SAVE(QPixmap, face);
SAVE(QPixmap, badge);
SAVE(int, obey);
- SAVE_ARRAY(Fraction, stat, (static_cast<const Pokemod*>(pokemod())->rules()->specialSplit() ? Pokemod::ST_End_GSC : Pokemod::ST_End_RBY));
+ SAVE_ARRAY(Fraction, stat, (static_cast<const Pokemod*>(pokemod())->rules()->specialSplit() ? ST_End_GSC : ST_End_RBY));
return xml;
}
-void Badge::setName(const QString& name)
+void Pokemod::Badge::setName(const QString& name)
{
CHECK(name);
}
-void Badge::setFace(const QPixmap& face)
+void Pokemod::Badge::setFace(const QPixmap& face)
{
if (face.size() != QSize(64, 64))
{
@@ -98,7 +99,7 @@ void Badge::setFace(const QPixmap& face)
emit(changed());
}
-void Badge::setBadge(const QPixmap& badge)
+void Pokemod::Badge::setBadge(const QPixmap& badge)
{
if (badge.size() != QSize(64, 64))
{
@@ -109,7 +110,7 @@ void Badge::setBadge(const QPixmap& badge)
emit(changed());
}
-void Badge::setObey(const int obey)
+void Pokemod::Badge::setObey(const int obey)
{
if (static_cast<const Pokemod*>(pokemod())->rules()->maxLevel() < obey)
{
@@ -119,14 +120,14 @@ void Badge::setObey(const int obey)
CHECK(obey);
}
-void Badge::setStat(const int stat, const Fraction& multiplier)
+void Pokemod::Badge::setStat(const int stat, const Fraction& multiplier)
{
if (multiplier < 1)
{
emit(error(bounds("stat multiplier")));
return;
}
- 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;
@@ -134,29 +135,29 @@ void Badge::setStat(const int stat, const Fraction& multiplier)
CHECK_ARRAY(stat[stat], multiplier);
}
-QString Badge::name() const
+QString Pokemod::Badge::name() const
{
return m_name;
}
-QPixmap Badge::face() const
+QPixmap Pokemod::Badge::face() const
{
return m_face;
}
-QPixmap Badge::badge() const
+QPixmap Pokemod::Badge::badge() const
{
return m_badge;
}
-int Badge::obey() const
+int Pokemod::Badge::obey() const
{
return m_obey;
}
-Fraction Badge::stat(const int stat) const
+Pokemod::Fraction Pokemod::Badge::stat(const int stat) const
{
- 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(warning(bounds("stat")));
return Fraction();
@@ -164,7 +165,7 @@ Fraction Badge::stat(const int stat) const
return m_stat[stat];
}
-Badge& Badge::operator=(const Badge& rhs)
+Pokemod::Badge& Pokemod::Badge::operator=(const Badge& rhs)
{
if (this == &rhs)
return *this;
@@ -172,6 +173,6 @@ Badge& Badge::operator=(const Badge& rhs)
COPY(face);
COPY(badge);
COPY(obey);
- COPY_ARRAY(stat, Pokemod::ST_End_GSC);
+ COPY_ARRAY(stat, ST_End_GSC);
return *this;
}