diff options
| author | Ben Boeckel <MathStuf@gmail.com> | 2008-01-21 00:44:23 +0000 |
|---|---|---|
| committer | Ben Boeckel <MathStuf@gmail.com> | 2008-01-21 00:44:23 +0000 |
| commit | 2b653821cc31f18adb5d50bb0bc19048939670dc (patch) | |
| tree | d333bbf0d1dde8fe0c1633bea60785b20ac07841 /pokemod/Ability.cpp | |
| parent | e27ba66952a1e851bb417611e0ed7df1fbf5f945 (diff) | |
| download | sigen-2b653821cc31f18adb5d50bb0bc19048939670dc.tar.gz sigen-2b653821cc31f18adb5d50bb0bc19048939670dc.tar.xz sigen-2b653821cc31f18adb5d50bb0bc19048939670dc.zip | |
[ADD] More GUI classes (only MoveEffect left)
[FIX] Polished up GUI classes
[FIX] renamed methods get*ByID -> get*Index instead for more logical get*ByID
[FIX] Renaming in pokemod to remove mention of Pokémon
[FIX] minor .pro fixes (aesthetic mainly)
git-svn-id: https://pokegen.svn.sourceforge.net/svnroot/pokegen/trunk@35 6ecfd1a5-f3ed-3746-8530-beee90d26b22
Diffstat (limited to 'pokemod/Ability.cpp')
| -rw-r--r-- | pokemod/Ability.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/pokemod/Ability.cpp b/pokemod/Ability.cpp index 576161c0..d5ff41d0 100644 --- a/pokemod/Ability.cpp +++ b/pokemod/Ability.cpp @@ -79,7 +79,7 @@ bool PokeMod::Ability::validate() const unsigned PokeMod::Ability::getNewId() const { unsigned i = 0; - for (; (i < getEffectCount()) && (getEffectByID(i) != UINT_MAX); ++i) + for (; (i < getEffectCount()) && (getEffectIndex(i) != UINT_MAX); ++i) ; return i; } @@ -137,7 +137,17 @@ PokeMod::AbilityEffect& PokeMod::Ability::getEffect(const unsigned i) throw(Inde return effects[i]; } -unsigned PokeMod::Ability::getEffectByID(const unsigned _id) const +const PokeMod::AbilityEffect& PokeMod::Ability::getEffectByID(const unsigned i) const throw(IndexException) +{ + return getEffect(getEffectIndex(i)); +} + +PokeMod::AbilityEffect& PokeMod::Ability::getEffectByID(const unsigned i) throw(IndexException) +{ + return getEffect(getEffectIndex(i)); +} + +unsigned PokeMod::Ability::getEffectIndex(const unsigned _id) const { for (unsigned i = 0; i < getEffectCount(); ++i) { |
