diff options
| author | Ben Boeckel <MathStuf@gmail.com> | 2008-01-21 17:13:11 +0000 |
|---|---|---|
| committer | Ben Boeckel <MathStuf@gmail.com> | 2008-01-21 17:13:11 +0000 |
| commit | a1fff27395d1930820e6c007fdedd8e9dc58f0b3 (patch) | |
| tree | f61c6b86b4a415fdc2bd0f7d6ca9bfdbfd8e8b64 /pokemod/Badge.cpp | |
| parent | 342fa6879e9fd8a757ebabe0a30370137b8d83a7 (diff) | |
| download | sigen-a1fff27395d1930820e6c007fdedd8e9dc58f0b3.tar.gz sigen-a1fff27395d1930820e6c007fdedd8e9dc58f0b3.tar.xz sigen-a1fff27395d1930820e6c007fdedd8e9dc58f0b3.zip | |
[FIX] PokeMod namespace removed
[ADD] MoveEffect editing form for PokéModr
git-svn-id: https://pokegen.svn.sourceforge.net/svnroot/pokegen/trunk@38 6ecfd1a5-f3ed-3746-8530-beee90d26b22
Diffstat (limited to 'pokemod/Badge.cpp')
| -rw-r--r-- | pokemod/Badge.cpp | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/pokemod/Badge.cpp b/pokemod/Badge.cpp index 0f780de5..8b41d456 100644 --- a/pokemod/Badge.cpp +++ b/pokemod/Badge.cpp @@ -24,7 +24,7 @@ #include "Pokemod.h" #include "Badge.h" -PokeMod::Badge::Badge(const Pokemod& par, const unsigned _id) : +Badge::Badge(const Pokemod& par, const unsigned _id) : Object(par, _id), name(""), obey(0) @@ -35,19 +35,19 @@ PokeMod::Badge::Badge(const Pokemod& par, const unsigned _id) : hm[i] = false; } -PokeMod::Badge::Badge(const Pokemod& par, const Badge& b, const unsigned _id) : +Badge::Badge(const Pokemod& par, const Badge& b, const unsigned _id) : Object(par, _id) { *this = b; } -PokeMod::Badge::Badge(const Pokemod& par, const QString& fname, const unsigned _id) : +Badge::Badge(const Pokemod& par, const QString& fname, const unsigned _id) : Object(par, _id) { load(fname, _id); } -bool PokeMod::Badge::validate() const +bool Badge::validate() const { bool valid = true; pokemod.validationMsg(QString("---Badge \"%1\" with id %2---").arg(name).arg(id), Pokemod::V_Msg); @@ -74,7 +74,7 @@ bool PokeMod::Badge::validate() const return valid; } -void PokeMod::Badge::load(const QString& fname, const unsigned _id) throw(Exception) +void Badge::load(const QString& fname, const unsigned _id) throw(Exception) { Ini ini(fname); if (_id == UINT_MAX) @@ -95,7 +95,7 @@ void PokeMod::Badge::load(const QString& fname, const unsigned _id) throw(Except ini.getValue(QString("hm-%1").arg(i), hm[i], false); } -void PokeMod::Badge::save() const throw(Exception) +void Badge::save() const throw(Exception) { Ini ini; ini.addField("id", id); @@ -111,12 +111,12 @@ void PokeMod::Badge::save() const throw(Exception) ini.save(QString("%1/badge/%2.pini").arg(pokemod.getPath()).arg(name)); } -void PokeMod::Badge::setName(const QString& n) +void Badge::setName(const QString& n) { name = n; } -void PokeMod::Badge::setFace(const QString& f) throw(Exception) +void Badge::setFace(const QString& f) throw(Exception) { QFile file(QString("%1/badge/%2/face.png").arg(pokemod.getPath()).arg(name)); if (file.exists() && !file.remove()) @@ -125,7 +125,7 @@ void PokeMod::Badge::setFace(const QString& f) throw(Exception) throw(SaveException("Badge", file.fileName())); } -void PokeMod::Badge::setBadge(const QString& b) throw(Exception) +void Badge::setBadge(const QString& b) throw(Exception) { QFile file(QString("%1/badge/%2/badge.png").arg(pokemod.getPath()).arg(name)); if (file.exists() && !file.remove()) @@ -134,66 +134,66 @@ void PokeMod::Badge::setBadge(const QString& b) throw(Exception) throw(SaveException("Badge", file.fileName())); } -void PokeMod::Badge::setObey(const unsigned o) throw(BoundsException) +void Badge::setObey(const unsigned o) throw(BoundsException) { if (pokemod.getRules().getMaxLevel() < o) throw(BoundsException("Badge", "obey")); obey = o; } -void PokeMod::Badge::setStat(const unsigned s, const unsigned n, const unsigned d) throw(Exception) +void Badge::setStat(const unsigned s, const unsigned n, const unsigned d) throw(Exception) { if ((pokemod.getRules().getSpecialSplit() ? ST_End_GSC : ST_End_RBY) <= s) throw(BoundsException("Badge", "stat")); stats[s].set(n, d); } -void PokeMod::Badge::setStatNum(const unsigned s, const unsigned n) throw(Exception) +void Badge::setStatNum(const unsigned s, const unsigned n) throw(Exception) { if ((pokemod.getRules().getSpecialSplit() ? ST_End_GSC : ST_End_RBY) <= s) throw(BoundsException("Badge", "stat")); stats[s].setNum(n); } -void PokeMod::Badge::setStatDenom(const unsigned s, const unsigned d) throw(Exception) +void Badge::setStatDenom(const unsigned s, const unsigned d) throw(Exception) { if ((pokemod.getRules().getSpecialSplit() ? ST_End_GSC : ST_End_RBY) <= s) throw(BoundsException("Badge", "stat")); stats[s].setDenom(d); } -void PokeMod::Badge::setHm(const unsigned h, const bool hb) throw(BoundsException) +void Badge::setHm(const unsigned h, const bool hb) throw(BoundsException) { if (HM_End_All <= h) throw(BoundsException("Badge", "hm")); hm[h] = hb; } -QString PokeMod::Badge::getName() const +QString Badge::getName() const { return name; } -unsigned PokeMod::Badge::getObey() const +unsigned Badge::getObey() const { return obey; } -Frac PokeMod::Badge::getStat(const unsigned s) const throw(BoundsException) +Frac Badge::getStat(const unsigned s) const throw(BoundsException) { if ((pokemod.getRules().getSpecialSplit() ? ST_End_GSC : ST_End_RBY) <= s) throw(BoundsException("Badge", "stat")); return stats[s]; } -bool PokeMod::Badge::getHm(const unsigned h) const throw(BoundsException) +bool Badge::getHm(const unsigned h) const throw(BoundsException) { if (HM_End_All <= h) throw(BoundsException("Badge", "hm")); return hm[h]; } -PokeMod::Badge& PokeMod::Badge::operator=(const Badge& rhs) +Badge& Badge::operator=(const Badge& rhs) { if (this == &rhs) return *this; |
