diff options
Diffstat (limited to 'pokemod/CoinList.cpp')
| -rw-r--r-- | pokemod/CoinList.cpp | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/pokemod/CoinList.cpp b/pokemod/CoinList.cpp index 78f33ac9..581f0d6e 100644 --- a/pokemod/CoinList.cpp +++ b/pokemod/CoinList.cpp @@ -31,26 +31,26 @@ #include "ItemEffect.h" #include "CoinList.h" -PokeMod::CoinList::CoinList(const Pokemod& par, const unsigned _id) : +CoinList::CoinList(const Pokemod& par, const unsigned _id) : Object(par, _id), name(""), value(0) { } -PokeMod::CoinList::CoinList(const Pokemod& par, const CoinList& c, const unsigned _id) : +CoinList::CoinList(const Pokemod& par, const CoinList& c, const unsigned _id) : Object(par, _id) { *this = c; } -PokeMod::CoinList::CoinList(const Pokemod& par, const QString& fname, const unsigned _id) : +CoinList::CoinList(const Pokemod& par, const QString& fname, const unsigned _id) : Object(par, _id) { load(fname, _id); } -bool PokeMod::CoinList::validate() const +bool CoinList::validate() const { bool valid = true; pokemod.validationMsg(QString("---Coin List \"%1\" with id %2---").arg(name).arg(id), Pokemod::V_Msg); @@ -121,7 +121,7 @@ bool PokeMod::CoinList::validate() const return valid; } -unsigned PokeMod::CoinList::getNewId() const +unsigned CoinList::getNewId() const { unsigned i = 0; for (; (i < getItemCount()) && (getItemIndex(i) != UINT_MAX); ++i) @@ -129,7 +129,7 @@ unsigned PokeMod::CoinList::getNewId() const return i; } -void PokeMod::CoinList::load(const QString& fname, const unsigned _id) throw(Exception) +void CoinList::load(const QString& fname, const unsigned _id) throw(Exception) { Ini ini(fname); if (_id == UINT_MAX) @@ -149,7 +149,7 @@ void PokeMod::CoinList::load(const QString& fname, const unsigned _id) throw(Exc } } -void PokeMod::CoinList::save() const throw(Exception) +void CoinList::save() const throw(Exception) { Ini ini; ini.addField("id", id); @@ -160,12 +160,12 @@ void PokeMod::CoinList::save() const throw(Exception) i.next().save(name); } -void PokeMod::CoinList::setName(const QString& n) +void CoinList::setName(const QString& n) { name = n; } -void PokeMod::CoinList::setValue(const unsigned v) throw(Exception) +void CoinList::setValue(const unsigned v) throw(Exception) { for (unsigned i = 0; (i < pokemod.getItemCount()); ++i) { @@ -181,41 +181,41 @@ void PokeMod::CoinList::setValue(const unsigned v) throw(Exception) throw(Exception("CoinList", "no compatable coin cases")); } -QString PokeMod::CoinList::getName() const +QString CoinList::getName() const { return name; } -unsigned PokeMod::CoinList::getValue() const +unsigned CoinList::getValue() const { return value; } -const PokeMod::CoinListObject& PokeMod::CoinList::getItem(const unsigned i) const throw(IndexException) +const CoinListObject& CoinList::getItem(const unsigned i) const throw(IndexException) { if (getItemCount() <= i) throw(IndexException("CoinList")); return items.at(i); } -PokeMod::CoinListObject& PokeMod::CoinList::getItem(const unsigned i) throw(IndexException) +CoinListObject& CoinList::getItem(const unsigned i) throw(IndexException) { if (getItemCount() <= i) throw(IndexException("CoinList")); return items[i]; } -const PokeMod::CoinListObject& PokeMod::CoinList::getItemByID(const unsigned i) const throw(IndexException) +const CoinListObject& CoinList::getItemByID(const unsigned i) const throw(IndexException) { return getItem(getItemIndex(i)); } -PokeMod::CoinListObject& PokeMod::CoinList::getItemByID(const unsigned i) throw(IndexException) +CoinListObject& CoinList::getItemByID(const unsigned i) throw(IndexException) { return getItem(getItemIndex(i)); } -unsigned PokeMod::CoinList::getItemIndex(const unsigned _id) const +unsigned CoinList::getItemIndex(const unsigned _id) const { for (unsigned i = 0; i < getItemCount(); ++i) { @@ -225,37 +225,37 @@ unsigned PokeMod::CoinList::getItemIndex(const unsigned _id) const return UINT_MAX; } -unsigned PokeMod::CoinList::getItemCount() const +unsigned CoinList::getItemCount() const { return items.size(); } -PokeMod::CoinListObject& PokeMod::CoinList::newItem() +CoinListObject& CoinList::newItem() { items.append(CoinListObject(pokemod, getNewId())); return items[getItemCount() - 1]; } -PokeMod::CoinListObject& PokeMod::CoinList::newItem(const QString& fname) +CoinListObject& CoinList::newItem(const QString& fname) { items.append(CoinListObject(pokemod, fname, getNewId())); return items[getItemCount() - 1]; } -PokeMod::CoinListObject& PokeMod::CoinList::newItem(const CoinListObject& o) +CoinListObject& CoinList::newItem(const CoinListObject& o) { items.append(CoinListObject(pokemod, o, getNewId())); return items[getItemCount() - 1]; } -void PokeMod::CoinList::deleteItem(const unsigned i) throw(IndexException) +void CoinList::deleteItem(const unsigned i) throw(IndexException) { if (getItemCount() <= i) throw(IndexException("CoinList")); items.removeAt(i); } -PokeMod::CoinList& PokeMod::CoinList::operator=(const CoinList& rhs) +CoinList& CoinList::operator=(const CoinList& rhs) { if (this == &rhs) return *this; |
