summaryrefslogtreecommitdiffstats
path: root/pokemod/Rules.h
blob: f3447f5c99e33c68ca82616a9bdb621a092643be (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
/////////////////////////////////////////////////////////////////////////////
// Name:        pokemod/Rules.h
// Purpose:     Rules for a PokéMod
// Author:      Ben Boeckel
// Modified by: Ben Boeckel
// Created:     Mon Nov 19 14:08:30 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/>.
/////////////////////////////////////////////////////////////////////////////

#ifndef __POKEMOD_RULES__
#define __POKEMOD_RULES__

#include <QString>
#include "../general/Exception.h"
#include "../general/Frac.h"
#include "Object.h"

namespace PokeMod
{
    class Pokemod;
    
    class Rules : public Object
    {
        public:
            Rules(const Pokemod& pokemod);
            Rules(const Pokemod& pokemod, const QString& fname);
            Rules(const Pokemod& pokemod, const Rules& r);
            
            void load(const QString& fname) throw(Exception);
            void save() const throw(Exception);
            
            void setGenderAllowed(const bool g);
            void setBreedingAllowed(const bool b) throw(Exception);
            void setHoldItems(const unsigned h);
            void setCriticalDomains(const bool c);
            void setAbilityAllowed(const bool a);
            void setNatureAllowed(const bool n);
            void setNumPokemonBoxes(const unsigned n);
            void setNumPokemonPerBox(const unsigned n);
            void setMaxParty(const unsigned m) throw(BoundsException);
            void setMaxFight(const unsigned m) throw(BoundsException);
            void setMaxMoves(const unsigned m) throw(BoundsException);
            void setMaxLevel(const unsigned m) throw(BoundsException);
            void setMaxMoney(const unsigned m);
            void setHardCash(const bool h);
            void setSpecialSplit(const bool s);
            void setSpecialDVSplit(const bool s);
            void setMaxDVValue(const unsigned char m) throw(BoundsException);
            void setHappiness(const bool h);
            void setHappyFaintLoss(const unsigned h);
            void setHappyLevelGain(const unsigned h);
            void setHappySteps(const unsigned h);
            void setEffortValuesAllowed(const bool e);
            void setMaxTotalEV(const unsigned m) throw(Exception);
            void setMaxEVPerStat(const unsigned m) throw(Exception);
            void setPokerusChance(const unsigned n, const unsigned d) throw(Exception);
            void setPokerusChanceNum(const unsigned n) throw(Exception);
            void setPokerusChanceDenom(const unsigned d) throw(Exception);
            
            bool getGenderAllowed() const;
            bool getBreedingAllowed() const;
            unsigned getHoldItems() const;
            bool getCriticalDomains() const;
            bool getAbilityAllowed() const;
            bool getNatureAllowed() const;
            unsigned getNumPokemonBoxes() const;
            unsigned getNumPokemonPerBox() const;
            unsigned getMaxParty() const;
            unsigned getMaxFight() const;
            unsigned getMaxMoves() const;
            unsigned getMaxLevel() const;
            unsigned getMaxMoney() const;
            bool getHardCash() const;
            bool getSpecialSplit() const;
            bool getSpecialDVSplit() const;
            unsigned char getMaxDVValue() const;
            bool getHappiness() const;
            unsigned getHappyFaintLoss() const;
            unsigned getHappyLevelGain() const;
            unsigned getHappySteps() const;
            bool getEffortValuesAllowed() const;
            unsigned getMaxTotalEV() const;
            unsigned getMaxEVPerStat() const;
            Frac getPokerusChance() const;
            
            Rules& operator=(const Rules& rhs);
        private:
            bool validate() const;
            
            bool genderAllowed;
            bool breedingAllowed;
            unsigned holdItems;
            bool criticalDomains;
            bool abilityAllowed;
            bool natureAllowed;
            unsigned numPokemonBoxes;
            unsigned numPokemonPerBox;
            unsigned maxParty;
            unsigned maxFight;
            unsigned maxMoves;
            unsigned maxLevel;
            unsigned maxMoney;
            bool hardCash;
            bool specialSplit;
            bool specialDVSplit;
            unsigned char maxDVValue;
            bool happiness;
            unsigned happyFaintLoss;
            unsigned happyLevelGain;
            unsigned happySteps;
            bool effortValuesAllowed;
            unsigned maxTotalEV;
            unsigned maxEVPerStat;
            Frac pokerusChance;
    };
}

#include "Pokemod.h"

#endif