diff options
| author | Ben Boeckel <MathStuf@gmail.com> | 2008-04-19 18:12:17 +0000 |
|---|---|---|
| committer | Ben Boeckel <MathStuf@gmail.com> | 2008-04-19 18:12:17 +0000 |
| commit | fe31331e2807634ae659e372358bac5781de9130 (patch) | |
| tree | 6b208974e3f141e9b22152526e2d42e967bfd4ec /pokemod/Move.cpp | |
| parent | 6679f5cffa9d35a23b76605ddfbf3257f882b6ee (diff) | |
[FIX] IndexException is more explicit
[FIX] Added SizeException for image validation
[FIX] QPixmaps are now verified
[FIX] Classes now use error and warning rather than throwing
[FIX] Deleted Object.cpp
git-svn-id: https://pokegen.svn.sourceforge.net/svnroot/pokegen/trunk@100 6ecfd1a5-f3ed-3746-8530-beee90d26b22
Diffstat (limited to 'pokemod/Move.cpp')
| -rw-r--r-- | pokemod/Move.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/pokemod/Move.cpp b/pokemod/Move.cpp index 21611be8..0ea33bc3 100644 --- a/pokemod/Move.cpp +++ b/pokemod/Move.cpp @@ -185,7 +185,7 @@ void Move::setPower(const int power) void Move::setType(const int type) throw(BoundsException) { if (pokemod()->typeIndex(type) == INT_MAX) - throw(BoundsException(className(), "type")); + error<BoundsException>("type"); m_type = type; } @@ -197,28 +197,28 @@ void Move::setSpecial(const bool special) void Move::setPowerPoints(const int powerPoints) throw(BoundsException) { if (!powerPoints) - throw(BoundsException(className(), "powerPoints")); + error<BoundsException>("powerPoints"); m_powerPoints = powerPoints; } void Move::setTarget(const int target) throw(BoundsException) { if (T_End <= target) - throw(BoundsException(className(), "target")); + error<BoundsException>("target"); m_target = target; } void Move::setNumTargets(const int numTargets) throw(BoundsException) { if (!numTargets || ((pokemod()->rules()->maxFight() * ((m_target == T_All) ? pokemod()->rules()->maxPlayers() : 1)) < numTargets)) - throw(BoundsException(className(), "numTargets")); + error<BoundsException>("numTargets"); m_numTargets = numTargets; } void Move::setTargetChoice(const int targetChoice) throw(BoundsException) { if (C_End <= targetChoice) - throw(BoundsException(className(), "targetChoice")); + error<BoundsException>("targetChoice"); m_targetChoice = targetChoice; } @@ -330,7 +330,7 @@ QString Move::description() const const MoveEffect* Move::effect(const int index) const throw(IndexException) { if (effectCount() <= index) - error<IndexException>("effect"); + warning<IndexException>("effect"); return m_effects.at(index); } |
