summaryrefslogtreecommitdiffstats
path: root/pokemod/Trainer.cpp
diff options
context:
space:
mode:
authorBen Boeckel <MathStuf@gmail.com>2008-08-18 18:51:31 +0000
committerBen Boeckel <MathStuf@gmail.com>2008-08-18 18:51:31 +0000
commitc1793a87ebea8c8e1bb2d5d1a409d105bfae3871 (patch)
treeb7ff53cf9747ad61a80b169e1adad96950f4b16c /pokemod/Trainer.cpp
parentfa4764c9e4d86fdfa976bb9fa9f6976e82c496d5 (diff)
downloadsigen-c1793a87ebea8c8e1bb2d5d1a409d105bfae3871.tar.gz
sigen-c1793a87ebea8c8e1bb2d5d1a409d105bfae3871.tar.xz
sigen-c1793a87ebea8c8e1bb2d5d1a409d105bfae3871.zip
[FIX] Script to make a tarball now defaults to HEAD for the revision
[FIX] Enumeration types used to help remove some checks [FIX] Macro code moved to static members of Object (not all though) [FIX] Scripting wrappers now share information by keeping track of already-created instances of the wrapper [FIX] Scripting methods are now Q_SCRIPTABLE and not slots git-svn-id: https://pokegen.svn.sourceforge.net/svnroot/pokegen/trunk@239 6ecfd1a5-f3ed-3746-8530-beee90d26b22
Diffstat (limited to 'pokemod/Trainer.cpp')
-rw-r--r--pokemod/Trainer.cpp86
1 files changed, 33 insertions, 53 deletions
diff --git a/pokemod/Trainer.cpp b/pokemod/Trainer.cpp
index 4c61ccc0..0c80fc57 100644
--- a/pokemod/Trainer.cpp
+++ b/pokemod/Trainer.cpp
@@ -64,40 +64,35 @@ void Pokemod::Trainer::validate()
emit(error("Name is empty"));
TEST(setMoneyFactor, moneyFactor);
TEST(setSkin, skin);
- TEST(setTeamIntel, teamIntel);
- TEST(setMoveIntel, moveIntel);
- TEST(setItemIntel, itemIntel);
- TEST(setAbilityIntel, abilityIntel);
- TEST(setStatIntel, statIntel);
TEST_END();
}
void Pokemod::Trainer::load(const QDomElement& xml)
{
LOAD_BEGIN();
- LOAD(QString, name);
- LOAD(int, moneyFactor);
- LOAD(int, skin);
- LOAD(int, depth);
- LOAD(int, teamIntel);
- LOAD(int, moveIntel);
- LOAD(int, itemIntel);
- LOAD(int, abilityIntel);
- LOAD(int, statIntel);
+ LOAD(name);
+ LOAD(moneyFactor);
+ LOAD(skin);
+ LOAD(depth);
+ LOAD(teamIntel);
+ LOAD(moveIntel);
+ LOAD(itemIntel);
+ LOAD(abilityIntel);
+ LOAD(statIntel);
}
QDomElement Pokemod::Trainer::save() const
{
SAVE_CREATE();
- SAVE(QString, name);
- SAVE(int, moneyFactor);
- SAVE(int, skin);
- SAVE(int, depth);
- SAVE(int, teamIntel);
- SAVE(int, moveIntel);
- SAVE(int, itemIntel);
- SAVE(int, abilityIntel);
- SAVE(int, statIntel);
+ SAVE(name);
+ SAVE(moneyFactor);
+ SAVE(skin);
+ SAVE(depth);
+ SAVE(teamIntel);
+ SAVE(moveIntel);
+ SAVE(itemIntel);
+ SAVE(abilityIntel);
+ SAVE(statIntel);
return xml;
}
@@ -127,44 +122,29 @@ void Pokemod::Trainer::setDepth(const int depth)
CHECK(depth);
}
-void Pokemod::Trainer::setTeamIntel(const int teamIntel)
+void Pokemod::Trainer::setTeamIntel(const Intelligence teamIntel)
{
- if (End <= teamIntel)
- emit(error(bounds("teamIntel")));
- else
- CHECK(teamIntel);
+ CHECK(teamIntel);
}
-void Pokemod::Trainer::setMoveIntel(const int moveIntel)
+void Pokemod::Trainer::setMoveIntel(const Intelligence moveIntel)
{
- if (End <= moveIntel)
- emit(error(bounds("moveIntel")));
- else
- CHECK(moveIntel);
+ CHECK(moveIntel);
}
-void Pokemod::Trainer::setItemIntel(const int itemIntel)
+void Pokemod::Trainer::setItemIntel(const Intelligence itemIntel)
{
- if (End <= itemIntel)
- emit(error(bounds("itemIntel")));
- else
- CHECK(itemIntel);
+ CHECK(itemIntel);
}
-void Pokemod::Trainer::setAbilityIntel(const int abilityIntel)
+void Pokemod::Trainer::setAbilityIntel(const Intelligence abilityIntel)
{
- if (End <= abilityIntel)
- emit(error(bounds("abilityIntel")));
- else
- CHECK(abilityIntel);
+ CHECK(abilityIntel);
}
-void Pokemod::Trainer::setStatIntel(const int statIntel)
+void Pokemod::Trainer::setStatIntel(const Intelligence statIntel)
{
- if (End <= statIntel)
- emit(error(bounds("statIntel")));
- else
- CHECK(statIntel);
+ CHECK(statIntel);
}
QString Pokemod::Trainer::name() const
@@ -187,27 +167,27 @@ int Pokemod::Trainer::depth() const
return m_depth;
}
-int Pokemod::Trainer::teamIntel() const
+Pokemod::Trainer::Intelligence Pokemod::Trainer::teamIntel() const
{
return m_teamIntel;
}
-int Pokemod::Trainer::moveIntel() const
+Pokemod::Trainer::Intelligence Pokemod::Trainer::moveIntel() const
{
return m_moveIntel;
}
-int Pokemod::Trainer::itemIntel() const
+Pokemod::Trainer::Intelligence Pokemod::Trainer::itemIntel() const
{
return m_itemIntel;
}
-int Pokemod::Trainer::abilityIntel() const
+Pokemod::Trainer::Intelligence Pokemod::Trainer::abilityIntel() const
{
return m_abilityIntel;
}
-int Pokemod::Trainer::statIntel() const
+Pokemod::Trainer::Intelligence Pokemod::Trainer::statIntel() const
{
return m_statIntel;
}