]> jfr.im git - irc/gameservirc.git/blob - gameserv-2.0/libgameservgldl/src/GameLayer/GameObjects/MasterGO.cpp
Changed Range to be a template class so it can be used with unsigned & signed ints...
[irc/gameservirc.git] / gameserv-2.0 / libgameservgldl / src / GameLayer / GameObjects / MasterGO.cpp
1 #include <GameServ/GameLayer/GameObjects/GameObject.h>
2 using GameServ::GameLayer::GameObjects::GameObject;
3 #include <GameServ/GameLayer/GameObjects/MasterGO.h>
4 using GameServ::GameLayer::GameObjects::MasterGO;
5
6 #include <GameServ/Types.h>
7 using GameServ::Types::ObjectTypes;
8
9 #include <string>
10 using std::string;
11
12 MasterGO::MasterGO() : GameObject()
13 {
14 mLevel = 0;
15 mExperience = 0;
16 mGold = 0;
17 mStrength = 0;
18 mDefense = 0;
19 mAlive = true;
20 }
21
22 MasterGO::MasterGO(const string &Id) : GameObject(Id)
23 {
24 mLevel = 0;
25 mExperience = 0;
26 mGold = 0;
27 mStrength = 0;
28 mDefense = 0;
29 mAlive = true;
30 }
31
32 MasterGO::~MasterGO()
33 {
34 }
35
36 MasterGO *MasterGO::Clone(void) const
37 {
38 return new MasterGO(*this);
39 }
40
41 void MasterGO::Level(const unsigned int &value)
42 {
43 mLevel = value;
44 }
45
46 unsigned int MasterGO::Level(void) const
47 {
48 return mLevel;
49 }
50
51 void MasterGO::Name(const string &value)
52 {
53 assert(!value.empty());
54 mName = value;
55 }
56
57 string MasterGO::Name(void) const
58 {
59 return mName;
60 }
61
62 void MasterGO::Strength(const int &value)
63 {
64 assert(value > 0);
65 mStrength = value;
66 }
67
68 int MasterGO::Strength(void) const
69 {
70 return mStrength;
71 }
72
73 void MasterGO::Defense(const int &value)
74 {
75 assert(value > 0);
76 mDefense = value;
77 }
78
79 int MasterGO::Defense(void) const
80 {
81 return mDefense;
82 }
83
84 void MasterGO::Gold(const unsigned long &value)
85 {
86 mGold = value;
87 }
88
89 unsigned long MasterGO::Gold(void) const
90 {
91 return mGold;
92 }
93 unsigned long int MasterGO::Experience(void) const
94 {
95 return mExperience;
96 }
97
98 void MasterGO::Experience(const unsigned long int &value)
99 {
100 mExperience = value;
101 }
102
103 void MasterGO::Health(const int &value)
104 {
105 mHealth = value;
106 }
107
108 int MasterGO::Health(void) const
109 {
110 return mHealth;
111 }
112
113 void MasterGO::MaxHealth(const int &value)
114 {
115 mMaxHealth = value;
116 }
117
118 int MasterGO::MaxHealth(void) const
119 {
120 return mMaxHealth;
121 }
122
123 void MasterGO::WeaponName(const string &value)
124 {
125 assert(!value.empty());
126 mWeaponName = value;
127 }
128
129 string MasterGO::WeaponName(void) const
130 {
131 return mWeaponName;
132 }
133
134 void MasterGO::PartingWords(const string &value)
135 {
136 assert(!value.empty());
137 mPartingWords = value;
138 }
139
140 string MasterGO::PartingWords(void) const
141 {
142 return mPartingWords;
143 }
144
145 void MasterGO::Alive(const bool &value)
146 {
147 mAlive = value;
148 }
149
150 bool MasterGO::Alive(void) const
151 {
152 return mAlive;
153 }
154
155 bool MasterGO::operator==(const MasterGO &right) const
156 {
157 return mId == right.mId && mHealth == right.mHealth &&
158 mDefense == right.mDefense && mPartingWords == right.mPartingWords &&
159 mGold == right.mGold && mHealth == right.mHealth &&
160 mMaxHealth == right.mMaxHealth && mName == right.mName &&
161 mStrength == right.mStrength && mWeaponName == right.mWeaponName;
162 }
163
164 bool MasterGO::operator!=(const MasterGO &right) const
165 {
166 return (!(*this == right));
167 }
168
169 ObjectTypes::ObjectType MasterGO::ObjectType(void) const
170 {
171 return ObjectTypes::Master;
172 }
173