From fe31331e2807634ae659e372358bac5781de9130 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Sat, 19 Apr 2008 18:12:17 +0000 Subject: [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 --- pokemod/Move.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'pokemod/Move.cpp') 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("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("powerPoints"); m_powerPoints = powerPoints; } void Move::setTarget(const int target) throw(BoundsException) { if (T_End <= target) - throw(BoundsException(className(), "target")); + error("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("numTargets"); m_numTargets = numTargets; } void Move::setTargetChoice(const int targetChoice) throw(BoundsException) { if (C_End <= targetChoice) - throw(BoundsException(className(), "targetChoice")); + error("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("effect"); + warning("effect"); return m_effects.at(index); } -- cgit