diff options
| author | Ben Boeckel <MathStuf@gmail.com> | 2008-01-21 06:38:00 +0000 |
|---|---|---|
| committer | Ben Boeckel <MathStuf@gmail.com> | 2008-01-21 06:38:00 +0000 |
| commit | 342fa6879e9fd8a757ebabe0a30370137b8d83a7 (patch) | |
| tree | 647fb184567a481dc86373116203740c2607f366 /pokemod/Badge.cpp | |
| parent | b2e515e6badeb033bbdb53b28424d3b8e7289067 (diff) | |
| download | sigen-342fa6879e9fd8a757ebabe0a30370137b8d83a7.tar.gz sigen-342fa6879e9fd8a757ebabe0a30370137b8d83a7.tar.xz sigen-342fa6879e9fd8a757ebabe0a30370137b8d83a7.zip | |
[FIX] const char*[] -> QStringList for easier laoding into KComboBox
[DEL] pokemod/pokemod_inc.h no longer needed
git-svn-id: https://pokegen.svn.sourceforge.net/svnroot/pokegen/trunk@37 6ecfd1a5-f3ed-3746-8530-beee90d26b22
Diffstat (limited to 'pokemod/Badge.cpp')
| -rw-r--r-- | pokemod/Badge.cpp | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/pokemod/Badge.cpp b/pokemod/Badge.cpp index 1cdad1e4..0f780de5 100644 --- a/pokemod/Badge.cpp +++ b/pokemod/Badge.cpp @@ -21,12 +21,9 @@ // with this program. If not, see <http://www.gnu.org/licenses/>. ///////////////////////////////////////////////////////////////////////////// -#include "../general/Ref.h" #include "Pokemod.h" #include "Badge.h" -const char* PokeMod::Badge::HMStr[PokeMod::Badge::End] = {"Cut", "Fly", "Surf", "Strength", "Flash", "Whirlpool", "Waterfall", "Dive", "Headbutt", "Rock Smash", "Defog", "Rock Climb"}; - PokeMod::Badge::Badge(const Pokemod& par, const unsigned _id) : Object(par, _id), name(""), @@ -34,7 +31,7 @@ PokeMod::Badge::Badge(const Pokemod& par, const unsigned _id) : { for (unsigned i = 0; i < ST_End_GSC; ++i) stats[i].set(1, 1); - for (unsigned i = 0; i < End; ++i) + for (unsigned i = 0; i < HM_End_All; ++i) hm[i] = false; } @@ -94,7 +91,7 @@ void PokeMod::Badge::load(const QString& fname, const unsigned _id) throw(Except ini.getValue(QString("stats-%1-d").arg(i), k, 1); stats[i].set(j, k); } - for (int i = 0; i < End; ++i) + for (int i = 0; i < HM_End_All; ++i) ini.getValue(QString("hm-%1").arg(i), hm[i], false); } @@ -109,7 +106,7 @@ void PokeMod::Badge::save() const throw(Exception) ini.addField(QString("stats-%1-n").arg(i), stats[i].getNum()); ini.addField(QString("stats-%1-d").arg(i), stats[i].getDenom()); } - for (int i = 0; i < End; ++i) + for (int i = 0; i < HM_End_All; ++i) ini.addField(QString("hm-%1").arg(i), hm[i]); ini.save(QString("%1/badge/%2.pini").arg(pokemod.getPath()).arg(name)); } @@ -167,7 +164,7 @@ void PokeMod::Badge::setStatDenom(const unsigned s, const unsigned d) throw(Exce void PokeMod::Badge::setHm(const unsigned h, const bool hb) throw(BoundsException) { - if (End <= h) + if (HM_End_All <= h) throw(BoundsException("Badge", "hm")); hm[h] = hb; } @@ -191,7 +188,7 @@ Frac PokeMod::Badge::getStat(const unsigned s) const throw(BoundsException) bool PokeMod::Badge::getHm(const unsigned h) const throw(BoundsException) { - if (End <= h) + if (HM_End_All <= h) throw(BoundsException("Badge", "hm")); return hm[h]; } @@ -204,7 +201,7 @@ PokeMod::Badge& PokeMod::Badge::operator=(const Badge& rhs) obey = rhs.obey; for (unsigned i = 0; i < ST_End_GSC; ++i) stats[i] = rhs.stats[i]; - for (unsigned i = 0; i < End; ++i) + for (unsigned i = 0; i < HM_End_All; ++i) hm[i] = rhs.hm[i]; return *this; } |
