From f80268eb885e28c603cc88523cfce2751d1448e1 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Sun, 7 Sep 2008 18:49:29 +0000 Subject: [FIX] Added a static poll method to Fraction [FIX] More Arena stuff fleshed out [FIX] Added priority scripts to Ability and Move [FIX] A SigmodWrapper pointer is now passed around the containments [FIX] Config now has templated methods for retrieving values git-svn-id: https://pokegen.svn.sourceforge.net/svnroot/pokegen/trunk@253 6ecfd1a5-f3ed-3746-8530-beee90d26b22 --- sigscript/RulesWrapper.cpp | 52 +++++++++++++++++++++++----------------------- 1 file changed, 26 insertions(+), 26 deletions(-) (limited to 'sigscript/RulesWrapper.cpp') diff --git a/sigscript/RulesWrapper.cpp b/sigscript/RulesWrapper.cpp index d549c395..f1493208 100644 --- a/sigscript/RulesWrapper.cpp +++ b/sigscript/RulesWrapper.cpp @@ -56,43 +56,43 @@ bool Sigscript::RulesWrapper::useTurns() const int Sigscript::RulesWrapper::numBoxes() const { - if (value("numBoxes").canConvert()) - return value("numBoxes").toInt(); + if (hasValueOfType("numBoxes")) + return valueOfType("numBoxes"); return m_rules->numBoxes(); } int Sigscript::RulesWrapper::boxSize() const { - if (value("boxSize").canConvert()) - return value("boxSize").toInt(); + if (hasValueOfType("boxSize")) + return valueOfType("boxSize"); return m_rules->boxSize(); } int Sigscript::RulesWrapper::maxParty() const { - if (value("maxParty").canConvert()) - return value("maxParty").toInt(); + if (hasValueOfType("maxParty")) + return valueOfType("maxParty"); return m_rules->maxParty(); } int Sigscript::RulesWrapper::maxFight() const { - if (value("maxFight").canConvert()) - return value("maxFight").toInt(); + if (hasValueOfType("maxFight")) + return valueOfType("maxFight"); return m_rules->maxFight(); } int Sigscript::RulesWrapper::maxPlayers() const { - if (value("maxFight").canConvert()) - return value("maxFight").toInt(); + if (hasValueOfType("maxFight")) + return valueOfType("maxFight"); return m_rules->maxPlayers(); } int Sigscript::RulesWrapper::maxHeldItems() const { - if (value("maxHeldItems").canConvert()) - return value("maxHeldItems").toInt(); + if (hasValueOfType("maxHeldItems")) + return valueOfType("maxHeldItems"); return m_rules->maxHeldItems(); } @@ -108,29 +108,29 @@ int Sigscript::RulesWrapper::maxNatures() const int Sigscript::RulesWrapper::maxMoves() const { - if (value("maxMoves").canConvert()) - return value("maxMoves").toInt(); + if (hasValueOfType("maxMoves")) + return valueOfType("maxMoves"); return m_rules->maxMoves(); } int Sigscript::RulesWrapper::maxLevel() const { - if (value("maxLevel").canConvert()) - return value("maxLevel").toInt(); + if (hasValueOfType("maxLevel")) + return valueOfType("maxLevel"); return m_rules->maxLevel(); } int Sigscript::RulesWrapper::maxStages() const { - if (value("maxStages").canConvert()) - return value("maxStages").toInt(); + if (hasValueOfType("maxStages")) + return valueOfType("maxStages"); return m_rules->maxStages(); } int Sigscript::RulesWrapper::maxMoney() const { - if (value("maxMoney").canConvert()) - return value("maxMoney").toInt(); + if (hasValueOfType("maxMoney")) + return valueOfType("maxMoney"); return m_rules->maxMoney(); } @@ -141,8 +141,8 @@ bool Sigscript::RulesWrapper::hardCash() const bool Sigscript::RulesWrapper::allowSwitchStyle() const { - if (value("allowSwitchStyle").canConvert()) - return value("allowSwitchStyle").toBool(); + if (hasValueOfType("allowSwitchStyle")) + return valueOfType("allowSwitchStyle"); return m_rules->allowSwitchStyle(); } @@ -163,14 +163,14 @@ bool Sigscript::RulesWrapper::effortValuesAllowed() const int Sigscript::RulesWrapper::maxTotalEV() const { - if (value("maxTotalEV").canConvert()) - return value("maxTotalEV").toInt(); + if (hasValueOfType("maxTotalEV")) + return valueOfType("maxTotalEV"); return m_rules->maxTotalEV(); } int Sigscript::RulesWrapper::maxEVPerStat() const { - if (value("maxEVPerStat").canConvert()) - return value("maxEVPerStat").toInt(); + if (hasValueOfType("maxEVPerStat")) + return valueOfType("maxEVPerStat"); return m_rules->maxEVPerStat(); } -- cgit