From cb83f5255b360d64c32c7e45d11d242e104e62f5 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Mon, 29 Dec 2008 12:06:26 -0500 Subject: Added macos for overriding values in sigscript --- sigscript/RulesWrapper.cpp | 45 +++++++++++++++------------------------------ 1 file changed, 15 insertions(+), 30 deletions(-) (limited to 'sigscript/RulesWrapper.cpp') diff --git a/sigscript/RulesWrapper.cpp b/sigscript/RulesWrapper.cpp index 39efd685..a5f78592 100644 --- a/sigscript/RulesWrapper.cpp +++ b/sigscript/RulesWrapper.cpp @@ -57,50 +57,43 @@ bool Sigscript::RulesWrapper::useTurns() const bool Sigscript::RulesWrapper::pausedATB() const { - if (sigmod()->singlePlayer() && hasValueOfType("pausedATB")) - return valueOfType("pausedATB"); + ALLOW_OVERRIDE_SO(rules, bool, pausedATB); return m_rules->pausedATB(); } int Sigscript::RulesWrapper::numBoxes() const { - if (sigmod()->singlePlayer() && hasValueOfType("numBoxes")) - return valueOfType("numBoxes"); + ALLOW_OVERRIDE_SO(rules, int, numBoxes); return m_rules->numBoxes(); } int Sigscript::RulesWrapper::boxSize() const { - if (sigmod()->singlePlayer() && hasValueOfType("boxSize")) - return valueOfType("boxSize"); + ALLOW_OVERRIDE_SO(rules, int, boxSize); return m_rules->boxSize(); } int Sigscript::RulesWrapper::maxParty() const { - if (sigmod()->singlePlayer() && hasValueOfType("maxParty")) - return valueOfType("maxParty"); + ALLOW_OVERRIDE_SO(rules, int, maxParty); return m_rules->maxParty(); } int Sigscript::RulesWrapper::maxFight() const { - if (sigmod()->singlePlayer() && hasValueOfType("maxFight")) - return valueOfType("maxFight"); + ALLOW_OVERRIDE_SO(rules, int, maxFight); return m_rules->maxFight(); } int Sigscript::RulesWrapper::maxPlayers() const { - if (sigmod()->singlePlayer() && hasValueOfType("maxFight")) - return valueOfType("maxFight"); + ALLOW_OVERRIDE_SO(rules, int, maxFight); return m_rules->maxPlayers(); } int Sigscript::RulesWrapper::maxHeldItems() const { - if (sigmod()->singlePlayer() && hasValueOfType("maxHeldItems")) - return valueOfType("maxHeldItems"); + ALLOW_OVERRIDE_SO(rules, int, maxHeldItems); return m_rules->maxHeldItems(); } @@ -116,43 +109,37 @@ int Sigscript::RulesWrapper::maxNatures() const int Sigscript::RulesWrapper::maxMoves() const { - if (sigmod()->singlePlayer() && hasValueOfType("maxMoves")) - return valueOfType("maxMoves"); + ALLOW_OVERRIDE_SO(rules, int, maxMoves); return m_rules->maxMoves(); } int Sigscript::RulesWrapper::maxLevel() const { - if (sigmod()->singlePlayer() && hasValueOfType("maxLevel")) - return valueOfType("maxLevel"); + ALLOW_OVERRIDE_SO(rules, int, maxLevel); return m_rules->maxLevel(); } int Sigscript::RulesWrapper::maxStages() const { - if (sigmod()->singlePlayer() && hasValueOfType("maxStages")) - return valueOfType("maxStages"); + ALLOW_OVERRIDE_SO(rules, int, maxStages); return m_rules->maxStages(); } int Sigscript::RulesWrapper::maxMoney() const { - if (sigmod()->singlePlayer() && hasValueOfType("maxMoney")) - return valueOfType("maxMoney"); + ALLOW_OVERRIDE_SO(rules, int, maxMoney); return m_rules->maxMoney(); } int Sigscript::RulesWrapper::maxTotalWeight() const { - if (sigmod()->singlePlayer() && hasValueOfType("maxTotalWeight")) - return valueOfType("maxTotalWeight"); + ALLOW_OVERRIDE_SO(rules, int, maxTotalWeight); return m_rules->maxTotalWeight(); } bool Sigscript::RulesWrapper::allowSwitchStyle() const { - if (sigmod()->singlePlayer() && hasValueOfType("allowSwitchStyle")) - return valueOfType("allowSwitchStyle"); + ALLOW_OVERRIDE_SO(rules, bool, allowSwitchStyle); return m_rules->allowSwitchStyle(); } @@ -173,14 +160,12 @@ bool Sigscript::RulesWrapper::effortValuesAllowed() const int Sigscript::RulesWrapper::maxTotalEV() const { - if (sigmod()->singlePlayer() && hasValueOfType("maxTotalEV")) - return valueOfType("maxTotalEV"); + ALLOW_OVERRIDE_SO(rules, int, maxTotalEV); return m_rules->maxTotalEV(); } int Sigscript::RulesWrapper::maxEVPerStat() const { - if (sigmod()->singlePlayer() && hasValueOfType("maxEVPerStat")) - return valueOfType("maxEVPerStat"); + ALLOW_OVERRIDE_SO(rules, int, maxEVPerStat); return m_rules->maxEVPerStat(); } -- cgit