summaryrefslogtreecommitdiffstats
path: root/pokemod/CoinList.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'pokemod/CoinList.cpp')
-rw-r--r--pokemod/CoinList.cpp54
1 files changed, 27 insertions, 27 deletions
diff --git a/pokemod/CoinList.cpp b/pokemod/CoinList.cpp
index f3bff007..336b2126 100644
--- a/pokemod/CoinList.cpp
+++ b/pokemod/CoinList.cpp
@@ -25,37 +25,37 @@
// Qt includes
#include <QSet>
-CoinList::CoinList(const CoinList& coinList) :
+Pokemod::CoinList::CoinList(const CoinList& coinList) :
Object("CoinList", coinList.parent(), coinList.id())
{
*this = coinList;
}
-CoinList::CoinList(const Pokemod* parent, const int id) :
+Pokemod::CoinList::CoinList(const Pokemod* parent, const int id) :
Object("CoinList", parent, id),
m_name(""),
m_script("", "")
{
}
-CoinList::CoinList(const CoinList& coinList, const Pokemod* parent, const int id) :
+Pokemod::CoinList::CoinList(const CoinList& coinList, const Pokemod* parent, const int id) :
Object("CoinList", parent, id)
{
*this = coinList;
}
-CoinList::CoinList(const QDomElement& xml, const Pokemod* parent, const int id) :
+Pokemod::CoinList::CoinList(const QDomElement& xml, const Pokemod* parent, const int id) :
Object("CoinList", parent, id)
{
load(xml, id);
}
-CoinList::~CoinList()
+Pokemod::CoinList::~CoinList()
{
clear();
}
-void CoinList::validate()
+void Pokemod::CoinList::validate()
{
if (m_name.isEmpty())
emit(error("Name is empty"));
@@ -85,7 +85,7 @@ void CoinList::validate()
}
}
-void CoinList::load(const QDomElement& xml, int id)
+void Pokemod::CoinList::load(const QDomElement& xml, int id)
{
LOAD_ID();
LOAD(QString, name);
@@ -93,7 +93,7 @@ void CoinList::load(const QDomElement& xml, int id)
LOAD_SUB(newObject, CoinListObject);
}
-QDomElement CoinList::save() const
+QDomElement Pokemod::CoinList::save() const
{
SAVE_CREATE();
SAVE(QString, name);
@@ -102,49 +102,49 @@ QDomElement CoinList::save() const
return xml;
}
-void CoinList::setName(const QString& name)
+void Pokemod::CoinList::setName(const QString& name)
{
CHECK(name);
}
-void CoinList::setScript(const Script& script)
+void Pokemod::CoinList::setScript(const Script& script)
{
CHECK(script)
}
-QString CoinList::name() const
+QString Pokemod::CoinList::name() const
{
return m_name;
}
-Script CoinList::script() const
+Pokemod::Script Pokemod::CoinList::script() const
{
return m_script;
}
-const CoinListObject* CoinList::object(const int index) const
+const Pokemod::CoinListObject* Pokemod::CoinList::object(const int index) const
{
Q_ASSERT(index < objectCount());
return m_objects.at(index);
}
-CoinListObject* CoinList::object(const int index)
+Pokemod::CoinListObject* Pokemod::CoinList::object(const int index)
{
Q_ASSERT(index < objectCount());
return m_objects[index];
}
-const CoinListObject* CoinList::objectById(const int id) const
+const Pokemod::CoinListObject* Pokemod::CoinList::objectById(const int id) const
{
return object(objectIndex(id));
}
-CoinListObject* CoinList::objectById(const int id)
+Pokemod::CoinListObject* Pokemod::CoinList::objectById(const int id)
{
return object(objectIndex(id));
}
-int CoinList::objectIndex(const int id) const
+int Pokemod::CoinList::objectIndex(const int id) const
{
for (int i = 0; i < objectCount(); ++i)
{
@@ -154,45 +154,45 @@ int CoinList::objectIndex(const int id) const
return INT_MAX;
}
-int CoinList::objectCount() const
+int Pokemod::CoinList::objectCount() const
{
return m_objects.size();
}
-CoinListObject* CoinList::newObject()
+Pokemod::CoinListObject* Pokemod::CoinList::newObject()
{
return newObject(new CoinListObject(this, objectId()));
}
-CoinListObject* CoinList::newObject(const QDomElement& xml)
+Pokemod::CoinListObject* Pokemod::CoinList::newObject(const QDomElement& xml)
{
return newObject(new CoinListObject(xml, this, objectId()));
}
-CoinListObject* CoinList::newObject(const CoinListObject& object)
+Pokemod::CoinListObject* Pokemod::CoinList::newObject(const CoinListObject& object)
{
return newObject(new CoinListObject(object, this, objectId()));
}
-CoinListObject* CoinList::newObject(CoinListObject* object)
+Pokemod::CoinListObject* Pokemod::CoinList::newObject(CoinListObject* object)
{
m_objects.append(object);
return object;
}
-void CoinList::deleteObject(const int index)
+void Pokemod::CoinList::deleteObject(const int index)
{
Q_ASSERT(index < objectCount());
delete m_objects[index];
m_objects.removeAt(index);
}
-void CoinList::deleteObjectById(const int id)
+void Pokemod::CoinList::deleteObjectById(const int id)
{
deleteObject(objectIndex(id));
}
-int CoinList::objectId() const
+int Pokemod::CoinList::objectId() const
{
int i = 0;
while ((i < objectCount()) && (objectIndex(i) != INT_MAX))
@@ -200,7 +200,7 @@ int CoinList::objectId() const
return i;
}
-CoinList& CoinList::operator=(const CoinList& rhs)
+Pokemod::CoinList& Pokemod::CoinList::operator=(const CoinList& rhs)
{
if (this == &rhs)
return *this;
@@ -211,7 +211,7 @@ CoinList& CoinList::operator=(const CoinList& rhs)
return *this;
}
-void CoinList::clear()
+void Pokemod::CoinList::clear()
{
while (objectCount())
deleteObject(0);