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/Trainer.cpp | |
| parent | 6679f5cffa9d35a23b76605ddfbf3257f882b6ee (diff) | |
| download | sigen-fe31331e2807634ae659e372358bac5781de9130.tar.gz sigen-fe31331e2807634ae659e372358bac5781de9130.tar.xz sigen-fe31331e2807634ae659e372358bac5781de9130.zip | |
[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/Trainer.cpp')
| -rw-r--r-- | pokemod/Trainer.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/pokemod/Trainer.cpp b/pokemod/Trainer.cpp index a4a86578..94a989fd 100644 --- a/pokemod/Trainer.cpp +++ b/pokemod/Trainer.cpp @@ -33,7 +33,8 @@ Trainer::Trainer(const Trainer& trainer) : Trainer::Trainer(const Pokemod* pokemod, const int id) : Object("Trainer", pokemod, id), m_name(""), - m_moneyFactor(0) + m_moneyFactor(0), + m_skin(192, 128) { } @@ -91,13 +92,14 @@ void Trainer::setName(const QString& name) void Trainer::setMoneyFactor(const int moneyFactor) throw(BoundsException) { if (moneyFactor < 0) - throw(BoundsException(className(), "moneyFactor")); + error<BoundsException>("moneyFactor"); m_moneyFactor = moneyFactor; } -void Trainer::setSkin(const QPixmap& skin) throw(Exception) +void Trainer::setSkin(const QPixmap& skin) throw(SizeException) { - // TODO: check dimensions + if (skin.size() != QSize(192, 128)) + error<SizeException>("skin"); m_skin = skin; } |
