diff options
| author | Ben Boeckel <MathStuf@gmail.com> | 2008-01-19 01:22:22 +0000 |
|---|---|---|
| committer | Ben Boeckel <MathStuf@gmail.com> | 2008-01-19 01:22:22 +0000 |
| commit | 342d0201b07d9030fced2f3baf3ecdefc841879a (patch) | |
| tree | f0715cc7b267e2ce2bc93971d9e95c7e0c9b2b62 /pokemod/Badge.cpp | |
| parent | d017d90324a439dfb4bd3f25d30deb672bc40fd4 (diff) | |
| download | sigen-342d0201b07d9030fced2f3baf3ecdefc841879a.tar.gz sigen-342d0201b07d9030fced2f3baf3ecdefc841879a.tar.xz sigen-342d0201b07d9030fced2f3baf3ecdefc841879a.zip | |
[DEL] Removed PokeGen namespace
[ADD] general/AudioCache.h completed
[DEL] VERSION removed from subdir .pro files
[DEL] audio/
git-svn-id: https://pokegen.svn.sourceforge.net/svnroot/pokegen/trunk@33 6ecfd1a5-f3ed-3746-8530-beee90d26b22
Diffstat (limited to 'pokemod/Badge.cpp')
| -rw-r--r-- | pokemod/Badge.cpp | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/pokemod/Badge.cpp b/pokemod/Badge.cpp index a07be4f3..d277cc31 100644 --- a/pokemod/Badge.cpp +++ b/pokemod/Badge.cpp @@ -23,9 +23,9 @@ #include "Badge.h" -const char* PokeGen::PokeMod::Badge::HMStr[PokeGen::PokeMod::Badge::End] = {"Cut", "Fly", "Surf", "Strength", "Flash", "Whirlpool", "Waterfall", "Dive", "Headbutt", "Rock Smash", "Defog", "Rock Climb"}; +const char* PokeMod::Badge::HMStr[PokeMod::Badge::End] = {"Cut", "Fly", "Surf", "Strength", "Flash", "Whirlpool", "Waterfall", "Dive", "Headbutt", "Rock Smash", "Defog", "Rock Climb"}; -PokeGen::PokeMod::Badge::Badge(const Pokemod& par, const unsigned _id) : +PokeMod::Badge::Badge(const Pokemod& par, const unsigned _id) : Object(par, _id), name(""), obey(0) @@ -36,19 +36,19 @@ PokeGen::PokeMod::Badge::Badge(const Pokemod& par, const unsigned _id) : hm[i] = false; } -PokeGen::PokeMod::Badge::Badge(const Pokemod& par, const Badge& b, const unsigned _id) : +PokeMod::Badge::Badge(const Pokemod& par, const Badge& b, const unsigned _id) : Object(par, _id) { *this = b; } -PokeGen::PokeMod::Badge::Badge(const Pokemod& par, const QString& fname, const unsigned _id) : +PokeMod::Badge::Badge(const Pokemod& par, const QString& fname, const unsigned _id) : Object(par, _id) { load(fname, _id); } -bool PokeGen::PokeMod::Badge::validate() const +bool PokeMod::Badge::validate() const { bool valid = true; pokemod.validationMsg(QString("---Badge \"%1\" with id %2---").arg(name).arg(id), Pokemod::V_Msg); @@ -75,7 +75,7 @@ bool PokeGen::PokeMod::Badge::validate() const return valid; } -void PokeGen::PokeMod::Badge::load(const QString& fname, const unsigned _id) throw(Exception) +void PokeMod::Badge::load(const QString& fname, const unsigned _id) throw(Exception) { Ini ini(fname); if (_id == UINT_MAX) @@ -96,7 +96,7 @@ void PokeGen::PokeMod::Badge::load(const QString& fname, const unsigned _id) thr ini.getValue(QString("hm-%1").arg(i), hm[i], false); } -void PokeGen::PokeMod::Badge::save() const throw(Exception) +void PokeMod::Badge::save() const throw(Exception) { Ini ini; ini.addField("id", id); @@ -112,12 +112,12 @@ void PokeGen::PokeMod::Badge::save() const throw(Exception) ini.save(QString("%1/badge/%2.pini").arg(pokemod.getPath()).arg(name)); } -void PokeGen::PokeMod::Badge::setName(const QString& n) +void PokeMod::Badge::setName(const QString& n) { name = n; } -void PokeGen::PokeMod::Badge::setFace(const QString& f) throw(Exception) +void PokeMod::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()) @@ -126,7 +126,7 @@ void PokeGen::PokeMod::Badge::setFace(const QString& f) throw(Exception) throw(SaveException("Badge", file.fileName())); } -void PokeGen::PokeMod::Badge::setBadge(const QString& b) throw(Exception) +void PokeMod::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()) @@ -135,80 +135,80 @@ void PokeGen::PokeMod::Badge::setBadge(const QString& b) throw(Exception) throw(SaveException("Badge", file.fileName())); } -void PokeGen::PokeMod::Badge::setObey(const unsigned o) throw(BoundsException) +void PokeMod::Badge::setObey(const unsigned o) throw(BoundsException) { if (pokemod.getRules().getMaxLevel() < o) throw(BoundsException("Badge", "obey")); obey = o; } -void PokeGen::PokeMod::Badge::setStat(const unsigned s, const unsigned n, const unsigned d) throw(Exception) +void PokeMod::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 PokeGen::PokeMod::Badge::setStatNum(const unsigned s, const unsigned n) throw(Exception) +void PokeMod::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 PokeGen::PokeMod::Badge::setStatDenom(const unsigned s, const unsigned d) throw(Exception) +void PokeMod::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 PokeGen::PokeMod::Badge::setHm(const unsigned h, const bool hb) throw(BoundsException) +void PokeMod::Badge::setHm(const unsigned h, const bool hb) throw(BoundsException) { if (End <= h) throw(BoundsException("Badge", "hm")); hm[h] = hb; } -QString PokeGen::PokeMod::Badge::getName() const +QString PokeMod::Badge::getName() const { return name; } -unsigned PokeGen::PokeMod::Badge::getObey() const +unsigned PokeMod::Badge::getObey() const { return obey; } -PokeGen::Frac PokeGen::PokeMod::Badge::getStat(const unsigned s) const throw(BoundsException) +Frac PokeMod::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]; } -unsigned PokeGen::PokeMod::Badge::getStatNum(const unsigned s) const throw(BoundsException) +unsigned PokeMod::Badge::getStatNum(const unsigned s) const throw(BoundsException) { if ((pokemod.getRules().getSpecialSplit() ? ST_End_GSC : ST_End_RBY) <= s) throw(BoundsException("Badge", "stat")); return getStat(s).getNum(); } -unsigned PokeGen::PokeMod::Badge::getStatDenom(const unsigned s) const throw(BoundsException) +unsigned PokeMod::Badge::getStatDenom(const unsigned s) const throw(BoundsException) { if ((pokemod.getRules().getSpecialSplit() ? ST_End_GSC : ST_End_RBY) <= s) throw(BoundsException("Badge", "stat")); return getStat(s).getDenom(); } -bool PokeGen::PokeMod::Badge::getHm(const unsigned h) const throw(BoundsException) +bool PokeMod::Badge::getHm(const unsigned h) const throw(BoundsException) { if (End <= h) throw(BoundsException("Badge", "hm")); return hm[h]; } -PokeGen::PokeMod::Badge& PokeGen::PokeMod::Badge::operator=(const Badge& rhs) +PokeMod::Badge& PokeMod::Badge::operator=(const Badge& rhs) { if (this == &rhs) return *this; |
