summaryrefslogtreecommitdiffstats
path: root/pokemod/Rules.cpp
diff options
context:
space:
mode:
authorBen Boeckel <MathStuf@gmail.com>2008-03-31 01:17:59 +0000
committerBen Boeckel <MathStuf@gmail.com>2008-03-31 01:17:59 +0000
commit9a65bc6bb7c8da1dfa5b101579e52845c75848ef (patch)
tree258900f882a6998ac6fa525bd247e302028a8911 /pokemod/Rules.cpp
parent8e1ec2aec50999bae30625303f2c96e5b3b7f318 (diff)
downloadsigen-9a65bc6bb7c8da1dfa5b101579e52845c75848ef.tar.gz
sigen-9a65bc6bb7c8da1dfa5b101579e52845c75848ef.tar.xz
sigen-9a65bc6bb7c8da1dfa5b101579e52845c75848ef.zip
[FIX] Member variables now use m_ prefix
[FIX] Lots of minor fixes git-svn-id: https://pokegen.svn.sourceforge.net/svnroot/pokegen/trunk@95 6ecfd1a5-f3ed-3746-8530-beee90d26b22
Diffstat (limited to 'pokemod/Rules.cpp')
-rw-r--r--pokemod/Rules.cpp579
1 files changed, 294 insertions, 285 deletions
diff --git a/pokemod/Rules.cpp b/pokemod/Rules.cpp
index bbc67147..3d2f2ca8 100644
--- a/pokemod/Rules.cpp
+++ b/pokemod/Rules.cpp
@@ -1,492 +1,501 @@
-/////////////////////////////////////////////////////////////////////////////
-// Name: pokemod/Rules.h
-// Purpose: Rules for a PokéMod
-// Author: Ben Boeckel
-// Modified by: Ben Boeckel
-// Created: Mon Nov 19 14:54:12 2007
-// Copyright: ©2007-2008 Ben Boeckel and Nerdy Productions
-// Licence:
-// This program is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License along
-// with this program. If not, see <http://www.gnu.org/licenses/>.
-/////////////////////////////////////////////////////////////////////////////
-
+/*
+ * Copyright 2007-2008 Ben Boeckel <MathStuf@gmail.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+// Pokemod includes
#include "Pokemod.h"
+
+// Header include
#include "Rules.h"
const QStringList Rules::DVStr = QStringList() << "16" << "32";
-Rules::Rules(const Pokemod* par) :
- Object("Rules", par, 0),
- genderAllowed(false),
- breedingAllowed(false),
- holdItems(0),
- criticalDomains(false),
- abilityAllowed(false),
- natureAllowed(false),
- numBoxes(0),
- boxSize(1),
- maxParty(1),
- maxFight(1),
- maxMoves(1),
- maxLevel(1),
- maxMoney(0),
- hardCash(false),
- specialSplit(false),
- specialDVSplit(false),
- maxDVValue(0),
- happiness(false),
- happyFaintLoss(0),
- happyLevelGain(0),
- happySteps(0),
- effortValuesAllowed(false),
- maxTotalEV(0),
- maxEVPerStat(0),
- pokerusChance(1, 1)
-{
-}
-
-Rules::Rules(const Pokemod* par, const Rules& r) :
- Object("Rules", par, 0)
-{
- *this = r;
-}
-
-Rules::Rules(const Pokemod* par, const QString& fname) :
- Object("Rules", par, 0)
-{
- load(fname);
+Rules::Rules(const Pokemod* pokemod) :
+ Object("Rules", pokemod, 0),
+ m_genderAllowed(false),
+ m_breedingAllowed(false),
+ m_holdItems(0),
+ m_criticalDomains(false),
+ m_abilityAllowed(false),
+ m_natureAllowed(false),
+ m_numBoxes(0),
+ m_boxSize(1),
+ m_maxParty(1),
+ m_maxFight(1),
+ m_maxPlayers(2),
+ m_maxMoves(1),
+ m_maxLevel(1),
+ m_maxMoney(0),
+ m_hardCash(false),
+ m_specialSplit(false),
+ m_specialDVSplit(false),
+ m_maxDVValue(0),
+ m_happiness(false),
+ m_happyFaintLoss(0),
+ m_happyLevelGain(0),
+ m_happySteps(0),
+ m_effortValuesAllowed(false),
+ m_maxTotalEV(0),
+ m_maxEVPerStat(0),
+ m_pokerusChance(1, 1)
+{
+}
+
+Rules::Rules(const Pokemod* pokemod, const Rules& rules) :
+ Object("Rules", pokemod, 0)
+{
+ *this = rules;
+}
+
+Rules::Rules(const Pokemod* pokemod, const QString& fileName) :
+ Object("Rules", pokemod, 0)
+{
+ load(fileName);
}
bool Rules::validate() const
{
bool valid = true;
- pokemod->validationMsg("---Rules", Pokemod::V_Msg);
- if (!numBoxes)
- pokemod->validationMsg("No box storage", Pokemod::V_Warn);
- else if (!boxSize)
+ pokemod()->validationMsg("---Rules", Pokemod::V_Msg);
+ if (!m_numBoxes)
+ pokemod()->validationMsg("No box storage", Pokemod::V_Warn);
+ else if (!m_boxSize)
{
- pokemod->validationMsg("Invalid box size");
+ pokemod()->validationMsg("Invalid box size");
valid = false;
}
- if (!maxParty)
+ if (!m_maxParty)
{
- pokemod->validationMsg("Invalid party size");
+ pokemod()->validationMsg("Invalid party size");
valid = false;
}
- if (!maxParty || (maxParty < maxFight))
+ if (!m_maxParty || (m_maxParty < m_maxFight))
{
- pokemod->validationMsg("Larger active than party");
+ pokemod()->validationMsg("Larger active than party");
valid = false;
}
- if (!maxMoves)
+ if (m_maxPlayers < 2)
{
- pokemod->validationMsg("No moves can be learned");
+ pokemod()->validationMsg("Cannot have battles without at least two players");
valid = false;
}
- if (!maxMoney)
- pokemod->validationMsg("Player cannot carry any money", Pokemod::V_Warn);
- if (1 < maxDVValue)
+ if (!m_maxMoves)
+ {
+ pokemod()->validationMsg("No moves can be learned");
+ valid = false;
+ }
+ if (!m_maxMoney)
+ pokemod()->validationMsg("Player cannot carry any money", Pokemod::V_Warn);
+ if (1 < m_maxDVValue)
{
- pokemod->validationMsg("Invalid maximum DV value");
+ pokemod()->validationMsg("Invalid maximum DV value");
valid = false;
}
- if (effortValuesAllowed)
+ if (m_effortValuesAllowed)
{
- if (maxTotalEV < maxEVPerStat)
+ if (m_maxTotalEV < m_maxEVPerStat)
{
- pokemod->validationMsg("More EV points are allowed on a stat than allowed overall");
+ pokemod()->validationMsg("More EV points are allowed on a stat than allowed overall");
valid = false;
}
}
- if (.005 < pokerusChance)
- pokemod->validationMsg("Pokérus chance is unusually high", Pokemod::V_Warn);
+ if (.005 < m_pokerusChance)
+ pokemod()->validationMsg("Pokérus chance is unusually high", Pokemod::V_Warn);
return valid;
}
-void Rules::load(const QString& fname, const int) throw(Exception)
+void Rules::load(const QString& fileName, const int) throw(Exception)
{
- Ini ini(fname);
+ Ini ini(fileName);
int i;
int j;
- ini.getValue("genderAllowed", genderAllowed, false);
- ini.getValue("breedingAllowed", breedingAllowed, false);
- ini.getValue("holdItems", holdItems, 0);
- ini.getValue("criticalDomains", criticalDomains, false);
- ini.getValue("abilityAllowed", abilityAllowed, false);
- ini.getValue("natureAllowed", natureAllowed, false);
- ini.getValue("numBoxes", numBoxes, 0);
- ini.getValue("boxSize", boxSize, 1);
- ini.getValue("maxParty", maxParty, 1);
- ini.getValue("maxFight", maxFight, 1);
- ini.getValue("maxMoves", maxMoves, 1);
- ini.getValue("maxLevel", maxLevel, 0);
- ini.getValue("maxMoney", maxMoney, 0);
- ini.getValue("hardCash", hardCash, false);
- ini.getValue("specialSplit", specialSplit, false);
- ini.getValue("specialDVSplit", specialDVSplit, false);
- ini.getValue("maxDVValue", maxDVValue, 16);
- ini.getValue("happiness", happiness, false);
- ini.getValue("happyFaintLoss", happyFaintLoss, 0);
- ini.getValue("happyLevelGain", happyLevelGain, 0);
- ini.getValue("happySteps", happySteps, 0);
- ini.getValue("effortValuesAllowed", effortValuesAllowed, false);
- ini.getValue("maxTotalEV", maxTotalEV, 0);
- ini.getValue("maxEVPerStat", maxEVPerStat, 0);
+ ini.getValue("genderAllowed", m_genderAllowed, false);
+ ini.getValue("breedingAllowed", m_breedingAllowed, false);
+ ini.getValue("holdItems", m_holdItems, 0);
+ ini.getValue("criticalDomains", m_criticalDomains, false);
+ ini.getValue("abilityAllowed", m_abilityAllowed, false);
+ ini.getValue("natureAllowed", m_natureAllowed, false);
+ ini.getValue("numBoxes", m_numBoxes, 0);
+ ini.getValue("boxSize", m_boxSize, 1);
+ ini.getValue("maxParty", m_maxParty, 1);
+ ini.getValue("maxFight", m_maxFight, 1);
+ ini.getValue("maxPlayers", m_maxPlayers, 2);
+ ini.getValue("maxMoves", m_maxMoves, 1);
+ ini.getValue("maxLevel", m_maxLevel, 0);
+ ini.getValue("maxMoney", m_maxMoney, 0);
+ ini.getValue("hardCash", m_hardCash, false);
+ ini.getValue("specialSplit", m_specialSplit, false);
+ ini.getValue("specialDVSplit", m_specialDVSplit, false);
+ ini.getValue("maxDVValue", m_maxDVValue, 16);
+ ini.getValue("happiness", m_happiness, false);
+ ini.getValue("happyFaintLoss", m_happyFaintLoss, 0);
+ ini.getValue("happyLevelGain", m_happyLevelGain, 0);
+ ini.getValue("happySteps", m_happySteps, 0);
+ ini.getValue("effortValuesAllowed", m_effortValuesAllowed, false);
+ ini.getValue("maxTotalEV", m_maxTotalEV, 0);
+ ini.getValue("maxEVPerStat", m_maxEVPerStat, 0);
ini.getValue("pokerusChance-n", i, 1);
ini.getValue("pokerusChance-d", j, 1);
- pokerusChance.set(i, j);
+ m_pokerusChance.set(i, j);
}
void Rules::save() const throw(Exception)
{
Ini ini;
- ini.addField("genderAllowed", genderAllowed);
- ini.addField("breedingAllowed", breedingAllowed);
- ini.addField("holdItems", holdItems);
- ini.addField("criticalDomains", criticalDomains);
- ini.addField("abilityAllowed", abilityAllowed);
- ini.addField("natureAllowed", natureAllowed);
- ini.addField("numBoxes", numBoxes);
- ini.addField("boxSize", boxSize);
- ini.addField("maxParty", maxParty);
- ini.addField("maxFight", maxFight);
- ini.addField("maxMoves", maxMoves);
- ini.addField("maxLevel", maxLevel);
- ini.addField("maxMoney", maxMoney);
- ini.addField("hardCash", hardCash);
- ini.addField("specialSplit", specialSplit);
- ini.addField("specialDVSplit", specialDVSplit);
- ini.addField("maxDVValue", maxDVValue);
- ini.addField("happiness", happiness);
- ini.addField("happyFaintLoss", happyFaintLoss);
- ini.addField("happyLevelGain", happyLevelGain);
- ini.addField("happySteps", happySteps);
- ini.addField("effortValuesAllowed", effortValuesAllowed);
- ini.addField("maxTotalEV", maxTotalEV);
- ini.addField("maxEVPerStat", maxEVPerStat);
- ini.addField("pokerusChance-n", pokerusChance.getNum());
- ini.addField("pokerusChance-d", pokerusChance.getDenom());
- ini.save(QString("%1/rules.pini").arg(pokemod->getPath()));
+ ini.addField("genderAllowed", m_genderAllowed);
+ ini.addField("breedingAllowed", m_breedingAllowed);
+ ini.addField("holdItems", m_holdItems);
+ ini.addField("criticalDomains", m_criticalDomains);
+ ini.addField("abilityAllowed", m_abilityAllowed);
+ ini.addField("natureAllowed", m_natureAllowed);
+ ini.addField("numBoxes", m_numBoxes);
+ ini.addField("boxSize", m_boxSize);
+ ini.addField("maxParty", m_maxParty);
+ ini.addField("maxFight", m_maxFight);
+ ini.addField("maxPlayers", m_maxPlayers);
+ ini.addField("maxMoves", m_maxMoves);
+ ini.addField("maxLevel", m_maxLevel);
+ ini.addField("maxMoney", m_maxMoney);
+ ini.addField("hardCash", m_hardCash);
+ ini.addField("specialSplit", m_specialSplit);
+ ini.addField("specialDVSplit", m_specialDVSplit);
+ ini.addField("maxDVValue", m_maxDVValue);
+ ini.addField("happiness", m_happiness);
+ ini.addField("happyFaintLoss", m_happyFaintLoss);
+ ini.addField("happyLevelGain", m_happyLevelGain);
+ ini.addField("happySteps", m_happySteps);
+ ini.addField("effortValuesAllowed", m_effortValuesAllowed);
+ ini.addField("maxTotalEV", m_maxTotalEV);
+ ini.addField("maxEVPerStat", m_maxEVPerStat);
+ ini.addField("pokerusChance-n", m_pokerusChance.numerator());
+ ini.addField("pokerusChance-d", m_pokerusChance.denominator());
+ ini.save(QString("%1/rules.pini").arg(pokemod()->path()));
}
-void Rules::setGenderAllowed(const bool g)
+void Rules::setGenderAllowed(const bool genderAllowed)
{
- genderAllowed = g;
+ m_genderAllowed = genderAllowed;
}
-void Rules::setBreedingAllowed(const bool b)
+void Rules::setBreedingAllowed(const bool breedingAllowed)
{
- breedingAllowed = b;
+ m_breedingAllowed = breedingAllowed;
}
-void Rules::setHoldItems(const int h)
+void Rules::setHoldItems(const int holdItems)
{
- holdItems = h;
+ m_holdItems = holdItems;
}
-void Rules::setCriticalDomains(const bool c)
+void Rules::setCriticalDomains(const bool criticalDomains)
{
- criticalDomains = c;
+ m_criticalDomains = criticalDomains;
}
-void Rules::setAbilityAllowed(const bool a)
+void Rules::setAbilityAllowed(const bool abilityAllowed)
{
- abilityAllowed = a;
+ m_abilityAllowed = abilityAllowed;
}
-void Rules::setNatureAllowed(const bool n)
+void Rules::setNatureAllowed(const bool natureAllowed)
{
- natureAllowed = n;
+ m_natureAllowed = natureAllowed;
}
-void Rules::setNumBoxes(const int n)
+void Rules::setNumBoxes(const int numBoxes)
{
- numBoxes = n;
+ m_numBoxes = numBoxes;
}
-void Rules::setBoxSize(const int b)
+void Rules::setBoxSize(const int boxSize)
{
- boxSize = b;
+ m_boxSize = boxSize;
}
-void Rules::setMaxParty(const int m) throw(BoundsException)
+void Rules::setMaxParty(const int maxParty) throw(BoundsException)
{
- if (!m)
- throw(BoundsException(className, "maxParty"));
- maxParty = m;
- if (m < maxFight)
- setMaxFight(m);
+ if (!maxParty)
+ throw(BoundsException(className(), "maxParty"));
+ m_maxParty = maxParty;
+ if (maxParty < m_maxFight)
+ setMaxFight(maxParty);
}
-void Rules::setMaxFight(const int m) throw(BoundsException)
+void Rules::setMaxFight(const int maxFight) throw(BoundsException)
{
- if (maxParty < m)
- throw(BoundsException(className, "maxFight"));
- maxFight = m;
+ if (m_maxParty < maxFight)
+ throw(BoundsException(className(), "maxFight"));
+ m_maxFight = maxFight;
}
-void Rules::setMaxMoves(const int m) throw(BoundsException)
+void Rules::setMaxPlayers(const int maxPlayers) throw(BoundsException)
{
- if (!m)
- throw(BoundsException(className, "maxMoves"));
- maxMoves = m;
+ if (!maxPlayers)
+ throw(BoundsException(className(), "maxPlayers"));
+ m_maxPlayers = maxPlayers;
}
-void Rules::setMaxLevel(const int m) throw(BoundsException)
+void Rules::setMaxMoves(const int maxMoves) throw(BoundsException)
{
- if (!m)
- throw(BoundsException(className, "maxLevel"));
- maxLevel = m;
+ if (!maxMoves)
+ throw(BoundsException(className(), "maxMoves"));
+ m_maxMoves = maxMoves;
}
-void Rules::setMaxMoney(const int m)
+void Rules::setMaxLevel(const int maxLevel) throw(BoundsException)
{
- maxMoney = m;
+ if (!maxLevel)
+ throw(BoundsException(className(), "maxLevel"));
+ m_maxLevel = maxLevel;
}
-void Rules::setHardCash(const bool h)
+void Rules::setMaxMoney(const int maxMoney)
{
- hardCash = h;
+ m_maxMoney = maxMoney;
}
-void Rules::setSpecialSplit(const bool s)
+void Rules::setHardCash(const bool hardCash)
{
- specialSplit = s;
- if (!s)
- setSpecialDVSplit(false);
+ m_hardCash = hardCash;
}
-void Rules::setSpecialDVSplit(const bool s)
+void Rules::setSpecialSplit(const bool specialSplit)
{
- specialDVSplit = s;
+ m_specialSplit = specialSplit;
+ if (!specialSplit)
+ setSpecialDVSplit(false);
}
-void Rules::setMaxDVValue(const unsigned char m) throw(BoundsException)
+void Rules::setSpecialDVSplit(const bool specialDVSplit)
{
- if (1 < m)
- throw(BoundsException(className, "maxDVValue"));
- maxDVValue = m;
+ m_specialDVSplit = specialDVSplit;
}
-void Rules::setHappiness(const bool h)
+void Rules::setMaxDVValue(const unsigned char maxDVValue) throw(BoundsException)
{
- happiness = h;
+ if (1 < maxDVValue)
+ throw(BoundsException(className(), "maxDVValue"));
+ m_maxDVValue = maxDVValue;
}
-void Rules::setHappyFaintLoss(const int h)
+void Rules::setHappiness(const bool happiness)
{
- happyFaintLoss = h;
+ m_happiness = happiness;
}
-void Rules::setHappyLevelGain(const int h)
+void Rules::setHappyFaintLoss(const int happyFaintLoss)
{
- happyLevelGain = h;
+ m_happyFaintLoss = happyFaintLoss;
}
-void Rules::setHappySteps(const int h)
+void Rules::setHappyLevelGain(const int happyLevelGain)
{
- happySteps = h;
+ m_happyLevelGain = happyLevelGain;
}
-void Rules::setEffortValuesAllowed(const bool e)
+void Rules::setHappySteps(const int happySteps)
{
- effortValuesAllowed = e;
+ m_happySteps = happySteps;
}
-void Rules::setMaxTotalEV(const int m) throw(BoundsException)
+void Rules::setEffortValuesAllowed(const bool effortValuesAllowed)
{
- if (!m)
- throw(BoundsException(className, "maxTotalEV"));
- maxTotalEV = m;
- if (m < maxEVPerStat)
- setMaxEVPerStat(m);
+ m_effortValuesAllowed = effortValuesAllowed;
}
-void Rules::setMaxEVPerStat(const int m) throw(BoundsException)
+void Rules::setMaxTotalEV(const int maxTotalEV) throw(BoundsException)
{
- if (!m || (maxTotalEV < m))
- throw(BoundsException(className, "maxEVPerStat"));
- maxEVPerStat = m;
+ if (!maxTotalEV)
+ throw(BoundsException(className(), "maxTotalEV"));
+ m_maxTotalEV = maxTotalEV;
+ if (maxTotalEV < m_maxEVPerStat)
+ setMaxEVPerStat(maxTotalEV);
}
-void Rules::setPokerusChance(const int n, const int d) throw(Exception)
+void Rules::setMaxEVPerStat(const int maxEVPerStat) throw(BoundsException)
{
- pokerusChance.set(n, d);
+ if (!maxEVPerStat || (m_maxTotalEV < maxEVPerStat))
+ throw(BoundsException(className(), "maxEVPerStat"));
+ m_maxEVPerStat = maxEVPerStat;
}
-void Rules::setPokerusChanceNum(const int n) throw(Exception)
+void Rules::setPokerusChance(const int numerator, const int denominator) throw(Exception)
{
- pokerusChance.setNum(n);
+ m_pokerusChance.set(numerator, denominator);
}
-void Rules::setPokerusChanceDenom(const int d) throw(Exception)
+bool Rules::genderAllowed() const
{
- pokerusChance.setDenom(d);
+ return m_genderAllowed;
}
-bool Rules::getGenderAllowed() const
+bool Rules::breedingAllowed() const
{
- return genderAllowed;
+ return m_breedingAllowed;
}
-bool Rules::getBreedingAllowed() const
+int Rules::holdItems() const
{
- return breedingAllowed;
+ return m_holdItems;
}
-int Rules::getHoldItems() const
+bool Rules::criticalDomains() const
{
- return holdItems;
+ return m_criticalDomains;
}
-bool Rules::getCriticalDomains() const
+bool Rules::abilityAllowed() const
{
- return criticalDomains;
+ return m_abilityAllowed;
}
-bool Rules::getAbilityAllowed() const
+bool Rules::natureAllowed() const
{
- return abilityAllowed;
+ return m_natureAllowed;
}
-bool Rules::getNatureAllowed() const
+int Rules::numBoxes() const
{
- return natureAllowed;
+ return m_numBoxes;
}
-int Rules::getNumBoxes() const
+int Rules::boxSize() const
{
- return numBoxes;
+ return m_boxSize;
}
-int Rules::getBoxSize() const
+int Rules::maxParty() const
{
- return boxSize;
+ return m_maxParty;
}
-int Rules::getMaxParty() const
+int Rules::maxFight() const
{
- return maxParty;
+ return m_maxFight;
}
-int Rules::getMaxFight() const
+int Rules::maxPlayers() const
{
- return maxFight;
+ return m_maxPlayers;
}
-int Rules::getMaxMoves() const
+int Rules::maxMoves() const
{
- return maxMoves;
+ return m_maxMoves;
}
-int Rules::getMaxLevel() const
+int Rules::maxLevel() const
{
- return maxLevel;
+ return m_maxLevel;
}
-int Rules::getMaxMoney() const
+int Rules::maxMoney() const
{
- return maxMoney;
+ return m_maxMoney;
}
-bool Rules::getHardCash() const
+bool Rules::hardCash() const
{
- return hardCash;
+ return m_hardCash;
}
-bool Rules::getSpecialSplit() const
+bool Rules::specialSplit() const
{
- return specialSplit;
+ return m_specialSplit;
}
-bool Rules::getSpecialDVSplit() const
+bool Rules::specialDVSplit() const
{
- return specialDVSplit;
+ return m_specialDVSplit;
}
-unsigned char Rules::getMaxDVValue() const
+unsigned char Rules::maxDVValue() const
{
- return maxDVValue;
+ return m_maxDVValue;
}
-bool Rules::getHappiness() const
+bool Rules::happiness() const
{
- return happiness;
+ return m_happiness;
}
-int Rules::getHappyFaintLoss() const
+int Rules::happyFaintLoss() const
{
- return happyFaintLoss;
+ return m_happyFaintLoss;
}
-int Rules::getHappyLevelGain() const
+int Rules::happyLevelGain() const
{
- return happyLevelGain;
+ return m_happyLevelGain;
}
-int Rules::getHappySteps() const
+int Rules::happySteps() const
{
- return happySteps;
+ return m_happySteps;
}
-bool Rules::getEffortValuesAllowed() const
+bool Rules::effortValuesAllowed() const
{
- return effortValuesAllowed;
+ return m_effortValuesAllowed;
}
-int Rules::getMaxTotalEV() const
+int Rules::maxTotalEV() const
{
- return maxTotalEV;
+ return m_maxTotalEV;
}
-int Rules::getMaxEVPerStat() const
+int Rules::maxEVPerStat() const
{
- return maxEVPerStat;
+ return m_maxEVPerStat;
}
-Frac Rules::getPokerusChance() const
+Frac Rules::pokerusChance() const
{
- return pokerusChance;
+ return m_pokerusChance;
}
Rules& Rules::operator=(const Rules& rhs)
{
if (this == &rhs)
return *this;
- genderAllowed = rhs.genderAllowed;
- breedingAllowed = rhs.breedingAllowed;
- holdItems = rhs.holdItems;
- criticalDomains = rhs.criticalDomains;
- abilityAllowed = rhs.abilityAllowed;
- natureAllowed = rhs.natureAllowed;
- numBoxes = rhs.numBoxes;
- boxSize = rhs.boxSize;
- maxParty = rhs.maxParty;
- maxFight = rhs.maxFight;
- maxMoves = rhs.maxMoves;
- maxLevel = rhs.maxLevel;
- maxMoney = rhs.maxMoney;
- hardCash = rhs.hardCash;
- specialSplit = rhs.specialSplit;
- specialDVSplit = rhs.specialDVSplit;
- maxDVValue = rhs.maxDVValue;
- happiness = rhs.happiness;
- happyFaintLoss = rhs.happyFaintLoss;
- happyLevelGain = rhs.happyLevelGain;
- happySteps = rhs.happySteps;
- effortValuesAllowed = rhs.effortValuesAllowed;
- maxTotalEV = rhs.maxTotalEV;
- maxEVPerStat = rhs.maxEVPerStat;
- pokerusChance = rhs.pokerusChance;
+ m_genderAllowed = rhs.m_genderAllowed;
+ m_breedingAllowed = rhs.m_breedingAllowed;
+ m_holdItems = rhs.m_holdItems;
+ m_criticalDomains = rhs.m_criticalDomains;
+ m_abilityAllowed = rhs.m_abilityAllowed;
+ m_natureAllowed = rhs.m_natureAllowed;
+ m_numBoxes = rhs.m_numBoxes;
+ m_boxSize = rhs.m_boxSize;
+ m_maxParty = rhs.m_maxParty;
+ m_maxFight = rhs.m_maxFight;
+ m_maxPlayers = rhs.m_maxPlayers;
+ m_maxMoves = rhs.m_maxMoves;
+ m_maxLevel = rhs.m_maxLevel;
+ m_maxMoney = rhs.m_maxMoney;
+ m_hardCash = rhs.m_hardCash;
+ m_specialSplit = rhs.m_specialSplit;
+ m_specialDVSplit = rhs.m_specialDVSplit;
+ m_maxDVValue = rhs.m_maxDVValue;
+ m_happiness = rhs.m_happiness;
+ m_happyFaintLoss = rhs.m_happyFaintLoss;
+ m_happyLevelGain = rhs.m_happyLevelGain;
+ m_happySteps = rhs.m_happySteps;
+ m_effortValuesAllowed = rhs.m_effortValuesAllowed;
+ m_maxTotalEV = rhs.m_maxTotalEV;
+ m_maxEVPerStat = rhs.m_maxEVPerStat;
+ m_pokerusChance = rhs.m_pokerusChance;
return *this;
}