summaryrefslogtreecommitdiffstats
path: root/sigmod/Rules.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'sigmod/Rules.cpp')
-rw-r--r--sigmod/Rules.cpp31
1 files changed, 31 insertions, 0 deletions
diff --git a/sigmod/Rules.cpp b/sigmod/Rules.cpp
index 22402a03..5442dbdf 100644
--- a/sigmod/Rules.cpp
+++ b/sigmod/Rules.cpp
@@ -36,6 +36,7 @@ Sigmod::Rules::Rules(const Sigmod* parent) :
m_breedingAllowed(false),
m_criticalDomains(false),
m_useTurns(true),
+ m_pausedATB(false),
m_numBoxes(0),
m_boxSize(1),
m_maxParty(1),
@@ -48,6 +49,7 @@ Sigmod::Rules::Rules(const Sigmod* parent) :
m_maxLevel(1),
m_maxStages(6),
m_maxMoney(0),
+ m_maxTotalWeight(0),
m_hardCash(false),
m_allowSwitchStyle(false),
m_specialSplit(false),
@@ -97,6 +99,7 @@ void Sigmod::Rules::load(const QDomElement& xml)
LOAD(breedingAllowed);
LOAD(criticalDomains);
LOAD(useTurns);
+ LOAD(pausedATB);
LOAD(numBoxes);
LOAD(boxSize);
LOAD(maxParty);
@@ -109,6 +112,7 @@ void Sigmod::Rules::load(const QDomElement& xml)
LOAD(maxLevel);
LOAD(maxStages);
LOAD(maxMoney);
+ LOAD(maxTotalWeight);
LOAD(hardCash);
LOAD(allowSwitchStyle);
LOAD(specialSplit);
@@ -125,6 +129,7 @@ QDomElement Sigmod::Rules::save() const
SAVE(breedingAllowed);
SAVE(criticalDomains);
SAVE(useTurns);
+ SAVE(pausedATB);
SAVE(numBoxes);
SAVE(boxSize);
SAVE(maxParty);
@@ -137,6 +142,7 @@ QDomElement Sigmod::Rules::save() const
SAVE(maxLevel);
SAVE(maxStages);
SAVE(maxMoney);
+ SAVE(maxTotalWeight);
SAVE(hardCash);
SAVE(allowSwitchStyle);
SAVE(specialSplit);
@@ -170,6 +176,14 @@ void Sigmod::Rules::setUseTurns(const bool useTurns)
CHECK(useTurns);
}
+void Sigmod::Rules::setPausedATB(const bool pausedATB)
+{
+ if (m_useTurns && pausedATB)
+ emit(error(bounds("pausedATB")));
+ else
+ CHECK(pausedATB);
+}
+
void Sigmod::Rules::setNumBoxes(const int numBoxes)
{
CHECK(numBoxes);
@@ -248,6 +262,11 @@ void Sigmod::Rules::setMaxMoney(const int maxMoney)
CHECK(maxMoney);
}
+void Sigmod::Rules::setMaxTotalWeight(const int maxTotalWeight)
+{
+ CHECK(maxTotalWeight);
+}
+
void Sigmod::Rules::setHardCash(const bool hardCash)
{
CHECK(hardCash);
@@ -312,6 +331,11 @@ bool Sigmod::Rules::useTurns() const
return m_useTurns;
}
+bool Sigmod::Rules::pausedATB() const
+{
+ return m_pausedATB;
+}
+
int Sigmod::Rules::numBoxes() const
{
return m_numBoxes;
@@ -372,6 +396,11 @@ int Sigmod::Rules::maxMoney() const
return m_maxMoney;
}
+int Sigmod::Rules::maxTotalWeight() const
+{
+ return m_maxTotalWeight;
+}
+
bool Sigmod::Rules::hardCash() const
{
return m_hardCash;
@@ -415,6 +444,7 @@ Sigmod::Rules& Sigmod::Rules::operator=(const Rules& rhs)
COPY(breedingAllowed);
COPY(criticalDomains);
COPY(useTurns);
+ COPY(pausedATB);
COPY(numBoxes);
COPY(boxSize);
COPY(maxParty);
@@ -427,6 +457,7 @@ Sigmod::Rules& Sigmod::Rules::operator=(const Rules& rhs)
COPY(maxLevel);
COPY(maxStages);
COPY(maxMoney);
+ COPY(maxTotalWeight);
COPY(hardCash);
COPY(allowSwitchStyle);
COPY(specialSplit);