diff options
Diffstat (limited to 'pokemod/Rules.cpp')
-rw-r--r-- | pokemod/Rules.cpp | 120 |
1 files changed, 60 insertions, 60 deletions
diff --git a/pokemod/Rules.cpp b/pokemod/Rules.cpp index fb2a32e3..fb88512a 100644 --- a/pokemod/Rules.cpp +++ b/pokemod/Rules.cpp @@ -22,7 +22,7 @@ #include "Rules.h" -PokeGen::PokeMod::Rules::Rules(const Pokemod& par) : +PokeMod::Rules::Rules(const Pokemod& par) : Object(par, 0), genderAllowed(false), breedingAllowed(false), @@ -52,13 +52,13 @@ PokeGen::PokeMod::Rules::Rules(const Pokemod& par) : { } -PokeGen::PokeMod::Rules::Rules(const Pokemod& par, const QString& fname) : +PokeMod::Rules::Rules(const Pokemod& par, const QString& fname) : Object(par, 0) { load(fname); } -bool PokeGen::PokeMod::Rules::validate() const +bool PokeMod::Rules::validate() const { bool valid = true; pokemod.validationMsg("---Rules", Pokemod::V_Msg); @@ -104,7 +104,7 @@ bool PokeGen::PokeMod::Rules::validate() const return valid; } -void PokeGen::PokeMod::Rules::load(const QString& fname) throw(Exception) +void PokeMod::Rules::load(const QString& fname) throw(Exception) { Ini ini(fname); unsigned i; @@ -138,7 +138,7 @@ void PokeGen::PokeMod::Rules::load(const QString& fname) throw(Exception) pokerusChance.set(i, j); } -void PokeGen::PokeMod::Rules::save() const throw(Exception) +void PokeMod::Rules::save() const throw(Exception) { Ini ini; ini.addField("genderAllowed", genderAllowed); @@ -170,138 +170,138 @@ void PokeGen::PokeMod::Rules::save() const throw(Exception) ini.save(QString("%1/rules.pini").arg(pokemod.getPath())); } -void PokeGen::PokeMod::Rules::setGenderAllowed(const bool g) +void PokeMod::Rules::setGenderAllowed(const bool g) { genderAllowed = g; if (!genderAllowed) breedingAllowed = false; } -void PokeGen::PokeMod::Rules::setBreedingAllowed(const bool b) throw(Exception) +void PokeMod::Rules::setBreedingAllowed(const bool b) throw(Exception) { if (!genderAllowed) throw(Exception("Rules", "cannot breed without genders")); breedingAllowed = b; } -void PokeGen::PokeMod::Rules::setHoldItems(const unsigned h) +void PokeMod::Rules::setHoldItems(const unsigned h) { holdItems = h; } -void PokeGen::PokeMod::Rules::setCriticalDomains(const bool c) +void PokeMod::Rules::setCriticalDomains(const bool c) { criticalDomains = c; } -void PokeGen::PokeMod::Rules::setAbilityAllowed(const bool a) +void PokeMod::Rules::setAbilityAllowed(const bool a) { abilityAllowed = a; } -void PokeGen::PokeMod::Rules::setNatureAllowed(const bool n) +void PokeMod::Rules::setNatureAllowed(const bool n) { natureAllowed = n; } -void PokeGen::PokeMod::Rules::setNumPokemonBoxes(const unsigned n) +void PokeMod::Rules::setNumPokemonBoxes(const unsigned n) { numPokemonBoxes = n; } -void PokeGen::PokeMod::Rules::setNumPokemonPerBox(const unsigned n) +void PokeMod::Rules::setNumPokemonPerBox(const unsigned n) { numPokemonPerBox = n; } -void PokeGen::PokeMod::Rules::setMaxParty(const unsigned m) throw(BoundsException) +void PokeMod::Rules::setMaxParty(const unsigned m) throw(BoundsException) { if (!m) throw(BoundsException("Rules", "maxParty")); maxParty = m; } -void PokeGen::PokeMod::Rules::setMaxFight(const unsigned m) throw(BoundsException) +void PokeMod::Rules::setMaxFight(const unsigned m) throw(BoundsException) { if (maxParty < m) throw(BoundsException("Rules", "maxFight")); maxFight = m; } -void PokeGen::PokeMod::Rules::setMaxMoves(const unsigned m) throw(BoundsException) +void PokeMod::Rules::setMaxMoves(const unsigned m) throw(BoundsException) { if (!m) throw(BoundsException("Rules", "maxMoves")); maxMoves = m; } -void PokeGen::PokeMod::Rules::setMaxLevel(const unsigned m) throw(BoundsException) +void PokeMod::Rules::setMaxLevel(const unsigned m) throw(BoundsException) { if (!m) throw(BoundsException("Rules", "maxLevel")); maxLevel = m; } -void PokeGen::PokeMod::Rules::setMaxMoney(const unsigned m) +void PokeMod::Rules::setMaxMoney(const unsigned m) { maxMoney = m; } -void PokeGen::PokeMod::Rules::setHardCash(const bool h) +void PokeMod::Rules::setHardCash(const bool h) { hardCash = h; } -void PokeGen::PokeMod::Rules::setSpecialSplit(const bool s) +void PokeMod::Rules::setSpecialSplit(const bool s) { specialSplit = s; } -void PokeGen::PokeMod::Rules::setSpecialDVSplit(const bool s) +void PokeMod::Rules::setSpecialDVSplit(const bool s) { specialDVSplit = s; } -void PokeGen::PokeMod::Rules::setMaxDVValue(const unsigned char m) throw(BoundsException) +void PokeMod::Rules::setMaxDVValue(const unsigned char m) throw(BoundsException) { if ((m != 16) && (m != 32)) throw(BoundsException("Rules", "maxDVValue")); maxDVValue = m; } -void PokeGen::PokeMod::Rules::setHappiness(const bool h) +void PokeMod::Rules::setHappiness(const bool h) { happiness = h; } -void PokeGen::PokeMod::Rules::setHappyFaintLoss(const unsigned h) +void PokeMod::Rules::setHappyFaintLoss(const unsigned h) { happyFaintLoss = h; } -void PokeGen::PokeMod::Rules::setHappyLevelGain(const unsigned h) +void PokeMod::Rules::setHappyLevelGain(const unsigned h) { happyLevelGain = h; } -void PokeGen::PokeMod::Rules::setHappySteps(const unsigned h) +void PokeMod::Rules::setHappySteps(const unsigned h) { happySteps = h; } -void PokeGen::PokeMod::Rules::setEffortValuesAllowed(const bool e) +void PokeMod::Rules::setEffortValuesAllowed(const bool e) { effortValuesAllowed = e; } -void PokeGen::PokeMod::Rules::setMaxTotalEV(const unsigned m) throw(Exception) +void PokeMod::Rules::setMaxTotalEV(const unsigned m) throw(Exception) { if (!effortValuesAllowed) throw(Exception("Rules", "no effort values")); maxTotalEV = m; } -void PokeGen::PokeMod::Rules::setMaxEVPerStat(const unsigned m) throw(Exception) +void PokeMod::Rules::setMaxEVPerStat(const unsigned m) throw(Exception) { if (!effortValuesAllowed) throw(Exception("Rules", "no effort values")); @@ -310,157 +310,157 @@ void PokeGen::PokeMod::Rules::setMaxEVPerStat(const unsigned m) throw(Exception) maxEVPerStat = m; } -void PokeGen::PokeMod::Rules::setPokerusChance(const unsigned n, const unsigned d) throw(Exception) +void PokeMod::Rules::setPokerusChance(const unsigned n, const unsigned d) throw(Exception) { pokerusChance.set(n, d); } -void PokeGen::PokeMod::Rules::setPokerusChanceNum(const unsigned n) throw(Exception) +void PokeMod::Rules::setPokerusChanceNum(const unsigned n) throw(Exception) { pokerusChance.setNum(n); } -void PokeGen::PokeMod::Rules::setPokerusChanceDenom(const unsigned d) throw(Exception) +void PokeMod::Rules::setPokerusChanceDenom(const unsigned d) throw(Exception) { pokerusChance.setDenom(d); } -bool PokeGen::PokeMod::Rules::getGenderAllowed() const +bool PokeMod::Rules::getGenderAllowed() const { return genderAllowed; } -bool PokeGen::PokeMod::Rules::getBreedingAllowed() const +bool PokeMod::Rules::getBreedingAllowed() const { return breedingAllowed; } -unsigned PokeGen::PokeMod::Rules::getHoldItems() const +unsigned PokeMod::Rules::getHoldItems() const { return holdItems; } -bool PokeGen::PokeMod::Rules::getCriticalDomains() const +bool PokeMod::Rules::getCriticalDomains() const { return criticalDomains; } -bool PokeGen::PokeMod::Rules::getAbilityAllowed() const +bool PokeMod::Rules::getAbilityAllowed() const { return abilityAllowed; } -bool PokeGen::PokeMod::Rules::getNatureAllowed() const +bool PokeMod::Rules::getNatureAllowed() const { return natureAllowed; } -unsigned PokeGen::PokeMod::Rules::getNumPokemonBoxes() const +unsigned PokeMod::Rules::getNumPokemonBoxes() const { return numPokemonBoxes; } -unsigned PokeGen::PokeMod::Rules::getNumPokemonPerBox() const +unsigned PokeMod::Rules::getNumPokemonPerBox() const { return numPokemonPerBox; } -unsigned PokeGen::PokeMod::Rules::getMaxParty() const +unsigned PokeMod::Rules::getMaxParty() const { return maxParty; } -unsigned PokeGen::PokeMod::Rules::getMaxFight() const +unsigned PokeMod::Rules::getMaxFight() const { return maxFight; } -unsigned PokeGen::PokeMod::Rules::getMaxMoves() const +unsigned PokeMod::Rules::getMaxMoves() const { return maxMoves; } -unsigned PokeGen::PokeMod::Rules::getMaxLevel() const +unsigned PokeMod::Rules::getMaxLevel() const { return maxLevel; } -unsigned PokeGen::PokeMod::Rules::getMaxMoney() const +unsigned PokeMod::Rules::getMaxMoney() const { return maxMoney; } -bool PokeGen::PokeMod::Rules::getHardCash() const +bool PokeMod::Rules::getHardCash() const { return hardCash; } -bool PokeGen::PokeMod::Rules::getSpecialSplit() const +bool PokeMod::Rules::getSpecialSplit() const { return specialSplit; } -bool PokeGen::PokeMod::Rules::getSpecialDVSplit() const +bool PokeMod::Rules::getSpecialDVSplit() const { return specialDVSplit; } -unsigned char PokeGen::PokeMod::Rules::getMaxDVValue() const +unsigned char PokeMod::Rules::getMaxDVValue() const { return maxDVValue; } -bool PokeGen::PokeMod::Rules::getHappiness() const +bool PokeMod::Rules::getHappiness() const { return happiness; } -unsigned PokeGen::PokeMod::Rules::getHappyFaintLoss() const +unsigned PokeMod::Rules::getHappyFaintLoss() const { return happyFaintLoss; } -unsigned PokeGen::PokeMod::Rules::getHappyLevelGain() const +unsigned PokeMod::Rules::getHappyLevelGain() const { return happyLevelGain; } -unsigned PokeGen::PokeMod::Rules::getHappySteps() const +unsigned PokeMod::Rules::getHappySteps() const { return happySteps; } -bool PokeGen::PokeMod::Rules::getEffortValuesAllowed() const +bool PokeMod::Rules::getEffortValuesAllowed() const { return effortValuesAllowed; } -unsigned PokeGen::PokeMod::Rules::getMaxTotalEV() const +unsigned PokeMod::Rules::getMaxTotalEV() const { return maxTotalEV; } -unsigned PokeGen::PokeMod::Rules::getMaxEVPerStat() const +unsigned PokeMod::Rules::getMaxEVPerStat() const { return maxEVPerStat; } -PokeGen::Frac PokeGen::PokeMod::Rules::getPokerusChance() const +Frac PokeMod::Rules::getPokerusChance() const { return pokerusChance; } -unsigned PokeGen::PokeMod::Rules::getPokerusChanceNum() const +unsigned PokeMod::Rules::getPokerusChanceNum() const { return pokerusChance.getNum(); } -unsigned PokeGen::PokeMod::Rules::getPokerusChanceDenom() const +unsigned PokeMod::Rules::getPokerusChanceDenom() const { return pokerusChance.getDenom(); } -PokeGen::PokeMod::Rules& PokeGen::PokeMod::Rules::operator=(const Rules& rhs) +PokeMod::Rules& PokeMod::Rules::operator=(const Rules& rhs) { if (this == &rhs) return *this; |