summaryrefslogtreecommitdiffstats
path: root/pokemod/Rules.h
blob: 1dad0b0bb00eaedb129ec7073e90fbbfad4c5cd6 (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
134
135
136
137
138
/*
 * 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/>.
 */

#ifndef __POKEMOD_RULES__
#define __POKEMOD_RULES__

// Pokemod includes
#include "Fraction.h"
#include "Object.h"

// Forward declarations
class Pokemod;

class Rules : public Object
{
    Q_OBJECT
    
    public:
        static const QStringList DVStr;
        
        Rules(const Rules& rules);
        Rules(const Pokemod* parent);
        Rules(const Rules& rules, const Pokemod* parent);
        Rules(const QDomElement& xml, const Pokemod* parent);
        
        void validate();
        
        void load(const QDomElement& xml, const int /*id*/ = 0);
        QDomElement save() const;
        
        void setGenderAllowed(const bool genderAllowed);
        void setBreedingAllowed(const bool breedingAllowed);
        void setCriticalDomains(const bool criticalDomains);
        void setMaxMultiplier(const int maxMultiplier);
        void setNumBoxes(const int numBoxes);
        void setBoxSize(const int boxSize);
        void setMaxParty(const int maxParty);
        void setMaxFight(const int maxFight);
        void setMaxPlayers(const int maxPlayers);
        void setMaxHeldItems(const int maxHeldItems);
        void setMaxAbilities(const int maxAbilities);
        void setMaxNatures(const int maxNatures);
        void setMaxMoves(const int maxMoves);
        void setMaxLevel(const int maxLevel);
        void setMaxStages(const int maxStage);
        void setMaxMoney(const int maxMoney);
        void setHardCash(const bool hardCash);
        void setAllowSwitchStyle(const bool allowSwitchStyle);
        void setSpecialSplit(const bool specialSplit);
        void setSpecialDVSplit(const bool specialDVSplit);
        void setMaxDVValue(const int maxDV);
        void setHappiness(const bool happiness);
        void setHappyFaintLoss(const int happyFaint);
        void setHappyLevelGain(const int happyLevel);
        void setHappySteps(const int happySteps);
        void setEffortValuesAllowed(const bool effortValues);
        void setMaxTotalEV(const int maxTotalEV);
        void setMaxEVPerStat(const int maxEVPerStat);
        void setPokerusChance(const Fraction& pokerusChance);
        
        bool genderAllowed() const;
        bool breedingAllowed() const;
        bool criticalDomains() const;
        int maxMultiplier() const;
        int numBoxes() const;
        int boxSize() const;
        int maxParty() const;
        int maxFight() const;
        int maxPlayers() const;
        int maxHeldItems() const;
        int maxAbilities() const;
        int maxNatures() const;
        int maxMoves() const;
        int maxLevel() const;
        int maxStages() const;
        int maxMoney() const;
        bool hardCash() const;
        bool allowSwitchStyle() const;
        bool specialSplit() const;
        bool specialDVSplit() const;
        int maxDVValue() const;
        bool happiness() const;
        int happyFaintLoss() const;
        int happyLevelGain() const;
        int happySteps() const;
        bool effortValuesAllowed() const;
        int maxTotalEV() const;
        int maxEVPerStat() const;
        Fraction pokerusChance() const;
        
        Rules& operator=(const Rules& rhs);
    private:
        bool m_genderAllowed;
        bool m_breedingAllowed;
        bool m_criticalDomains;
        int m_maxMultiplier;
        int m_numBoxes;
        int m_boxSize;
        int m_maxParty;
        int m_maxFight;
        int m_maxPlayers;
        int m_maxHeldItems;
        int m_maxAbilities;
        int m_maxNatures;
        int m_maxMoves;
        int m_maxLevel;
        int m_maxStages;
        int m_maxMoney;
        bool m_hardCash;
        bool m_allowSwitchStyle;
        bool m_specialSplit;
        bool m_specialDVSplit;
        int m_maxDVValue;
        bool m_happiness;
        int m_happyFaintLoss;
        int m_happyLevelGain;
        int m_happySteps;
        bool m_effortValuesAllowed;
        int m_maxTotalEV;
        int m_maxEVPerStat;
        Fraction m_pokerusChance;
};

#endif