diff options
Diffstat (limited to 'pokemod/Move.cpp')
| -rw-r--r-- | pokemod/Move.cpp | 98 |
1 files changed, 49 insertions, 49 deletions
diff --git a/pokemod/Move.cpp b/pokemod/Move.cpp index 4eecccb1..326a0368 100644 --- a/pokemod/Move.cpp +++ b/pokemod/Move.cpp @@ -28,10 +28,10 @@ #include "Pokemod.h" #include "Move.h" -const QStringList PokeMod::Move::TargetStr = QStringList() << "Player" << "Enemy" << "Both" << "Random"; -const QStringList PokeMod::Move::ChoiceStr = QStringList() << "Player" << "Enemy" << "Random"; +const QStringList Move::TargetStr = QStringList() << "Player" << "Enemy" << "Both" << "Random"; +const QStringList Move::ChoiceStr = QStringList() << "Player" << "Enemy" << "Random"; -PokeMod::Move::Move(const Pokemod& par, const unsigned _id) : +Move::Move(const Pokemod& par, const unsigned _id) : Object(par, _id), name(""), accuracy(1, 1), @@ -50,19 +50,19 @@ PokeMod::Move::Move(const Pokemod& par, const unsigned _id) : { } -PokeMod::Move::Move(const Pokemod& par, const Move& m, const unsigned _id) : +Move::Move(const Pokemod& par, const Move& m, const unsigned _id) : Object(par, _id) { *this = m; } -PokeMod::Move::Move(const Pokemod& par, const QString& fname, const unsigned _id) : +Move::Move(const Pokemod& par, const QString& fname, const unsigned _id) : Object(par, _id) { load(fname, _id); } -bool PokeMod::Move::validate() const +bool Move::validate() const { bool valid = true; pokemod.validationMsg(QString("---Move \"%1\" with id %2---").arg(name).arg(id), Pokemod::V_Msg); @@ -122,7 +122,7 @@ bool PokeMod::Move::validate() const return valid; } -unsigned PokeMod::Move::getNewId() const +unsigned Move::getNewId() const { unsigned i = 0; for (; (i < getEffectCount()) && (getEffectIndex(i) != UINT_MAX); ++i) @@ -130,7 +130,7 @@ unsigned PokeMod::Move::getNewId() const return i; } -void PokeMod::Move::load(const QString& fname, const unsigned _id) throw(Exception) +void Move::load(const QString& fname, const unsigned _id) throw(Exception) { Ini ini(fname); if (_id == UINT_MAX) @@ -167,7 +167,7 @@ void PokeMod::Move::load(const QString& fname, const unsigned _id) throw(Excepti } } -void PokeMod::Move::save() const throw(Exception) +void Move::save() const throw(Exception) { Ini ini; ini.addField("id", id); @@ -192,186 +192,186 @@ void PokeMod::Move::save() const throw(Exception) i.next().save(name); } -void PokeMod::Move::setName(const QString& n) +void Move::setName(const QString& n) { name = n; } -void PokeMod::Move::setAccuracy(const unsigned n, const unsigned d) throw(Exception) +void Move::setAccuracy(const unsigned n, const unsigned d) throw(Exception) { accuracy.set(n, d); } -void PokeMod::Move::setAccuracyNum(const unsigned n) throw(Exception) +void Move::setAccuracyNum(const unsigned n) throw(Exception) { accuracy.setNum(n); } -void PokeMod::Move::setAccuracyDenom(const unsigned d) throw(Exception) +void Move::setAccuracyDenom(const unsigned d) throw(Exception) { accuracy.setDenom(d); } -void PokeMod::Move::setType(const unsigned t) throw(BoundsException) +void Move::setType(const unsigned t) throw(BoundsException) { if (pokemod.getTypeIndex(t) == UINT_MAX) throw(BoundsException("Move", "type")); type = t; } -void PokeMod::Move::setSpecial(const bool s) +void Move::setSpecial(const bool s) { special = s; } -void PokeMod::Move::setPowerPoints(const unsigned p) throw(BoundsException) +void Move::setPowerPoints(const unsigned p) throw(BoundsException) { if (!p) throw(BoundsException("Move", "powerPoints")); powerPoints = p; } -void PokeMod::Move::setTarget(const unsigned t) throw(BoundsException) +void Move::setTarget(const unsigned t) throw(BoundsException) { if (T_End <= t) throw(BoundsException("Move", "target")); target = t; } -void PokeMod::Move::setNumTargets(const unsigned n) throw(BoundsException) +void Move::setNumTargets(const unsigned n) throw(BoundsException) { if (!n || ((pokemod.getRules().getMaxFight() << 1) < n)) throw(BoundsException("Move", "numTargets")); numTargets = n; } -void PokeMod::Move::setTargetChoice(const unsigned t) throw(BoundsException) +void Move::setTargetChoice(const unsigned t) throw(BoundsException) { if (C_End <= t) throw(BoundsException("Move", "targetChoice")); targetChoice = t; } -void PokeMod::Move::setIgnoreAccuracy(const bool i) +void Move::setIgnoreAccuracy(const bool i) { ignoreAccuracy = i; } -void PokeMod::Move::setCanFlinch(const bool c) +void Move::setCanFlinch(const bool c) { canFlinch = c; } -void PokeMod::Move::setCanRandom(const bool c) +void Move::setCanRandom(const bool c) { canRandom = c; } -void PokeMod::Move::setCanSnatch(const bool c) +void Move::setCanSnatch(const bool c) { canSnatch = c; } -void PokeMod::Move::setSound(const bool s) +void Move::setSound(const bool s) { sound = s; } -QString PokeMod::Move::getName() const +QString Move::getName() const { return name; } -Frac PokeMod::Move::getAccuracy() const +Frac Move::getAccuracy() const { return accuracy; } -unsigned PokeMod::Move::getType() const +unsigned Move::getType() const { return type; } -bool PokeMod::Move::getSpecial() const +bool Move::getSpecial() const { return special; } -unsigned PokeMod::Move::getPowerPoints() const +unsigned Move::getPowerPoints() const { return powerPoints; } -unsigned PokeMod::Move::getTarget() const +unsigned Move::getTarget() const { return target; } -unsigned PokeMod::Move::getNumTargets() const +unsigned Move::getNumTargets() const { return numTargets; } -unsigned PokeMod::Move::getTargetChoice() const +unsigned Move::getTargetChoice() const { return targetChoice; } -bool PokeMod::Move::getIgnoreAccuracy() const +bool Move::getIgnoreAccuracy() const { return ignoreAccuracy; } -bool PokeMod::Move::getCanFlinch() const +bool Move::getCanFlinch() const { return canFlinch; } -bool PokeMod::Move::getCanRandom() const +bool Move::getCanRandom() const { return canRandom; } -bool PokeMod::Move::getCanSnatch() const +bool Move::getCanSnatch() const { return canSnatch; } -bool PokeMod::Move::getSound() const +bool Move::getSound() const { return sound; } -QString PokeMod::Move::getDescription() const +QString Move::getDescription() const { return description; } -const PokeMod::MoveEffect& PokeMod::Move::getEffect(const unsigned i) const throw(IndexException) +const MoveEffect& Move::getEffect(const unsigned i) const throw(IndexException) { if (getEffectCount() <= i) throw(IndexException("Move")); return effects.at(i); } -PokeMod::MoveEffect& PokeMod::Move::getEffect(const unsigned i) throw(IndexException) +MoveEffect& Move::getEffect(const unsigned i) throw(IndexException) { if (getEffectCount() <= i) throw(IndexException("Move")); return effects[i]; } -const PokeMod::MoveEffect& PokeMod::Move::getEffectByID(const unsigned i) const throw(IndexException) +const MoveEffect& Move::getEffectByID(const unsigned i) const throw(IndexException) { return getEffect(getEffectIndex(i)); } -PokeMod::MoveEffect& PokeMod::Move::getEffectByID(const unsigned i) throw(IndexException) +MoveEffect& Move::getEffectByID(const unsigned i) throw(IndexException) { return getEffect(getEffectIndex(i)); } -unsigned PokeMod::Move::getEffectIndex(const unsigned _id) const +unsigned Move::getEffectIndex(const unsigned _id) const { for (unsigned i = 0; i < getEffectCount(); ++i) { @@ -381,37 +381,37 @@ unsigned PokeMod::Move::getEffectIndex(const unsigned _id) const return UINT_MAX; } -unsigned PokeMod::Move::getEffectCount() const +unsigned Move::getEffectCount() const { return effects.size(); } -PokeMod::MoveEffect& PokeMod::Move::newEffect() +MoveEffect& Move::newEffect() { effects.append(MoveEffect(pokemod, getNewId())); return effects[getEffectCount() - 1]; } -PokeMod::MoveEffect& PokeMod::Move::newEffect(const QString& fname) +MoveEffect& Move::newEffect(const QString& fname) { effects.append(MoveEffect(pokemod, fname, getNewId())); return effects[getEffectCount() - 1]; } -PokeMod::MoveEffect& PokeMod::Move::newEffect(const MoveEffect& e) +MoveEffect& Move::newEffect(const MoveEffect& e) { effects.append(MoveEffect(pokemod, e, getNewId())); return effects[getEffectCount() - 1]; } -void PokeMod::Move::deleteEffect(const unsigned i) throw(IndexException) +void Move::deleteEffect(const unsigned i) throw(IndexException) { if (getEffectCount() <= i) throw(IndexException("Move")); effects.removeAt(i); } -PokeMod::Move& PokeMod::Move::operator=(const Move& rhs) +Move& Move::operator=(const Move& rhs) { if (this == &rhs) return *this; |
