]> jfr.im git - irc/gameservirc.git/blob - gameserv-2.0/libgameservgldl/src/GameLayer/GameObjects/MasterGO.cpp
Changed the ItemGO class to be abstract so you cannot define a simple ItemGO object...
[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()
13 {
14 }
15
16 MasterGO::MasterGO(const string &Id) : GameObject(Id)
17 {
18 }
19
20 MasterGO::~MasterGO()
21 {
22 }
23
24 MasterGO *MasterGO::Clone(void) const
25 {
26 return new MasterGO(*this);
27 }
28
29 void MasterGO::Name(const string &value)
30 {
31 assert(!value.empty());
32 mName = value;
33 }
34
35 string MasterGO::Name(void) const
36 {
37 return mName;
38 }
39
40 void MasterGO::Strength(const int &value)
41 {
42 assert(value > 0);
43 mStrength = value;
44 }
45
46 int MasterGO::Strength(void) const
47 {
48 return mStrength;
49 }
50
51 void MasterGO::Defense(const int &value)
52 {
53 assert(value > 0);
54 mDefense = value;
55 }
56
57 int MasterGO::Defense(void) const
58 {
59 return mDefense;
60 }
61
62 void MasterGO::Gold(const unsigned long &value)
63 {
64 mGold = value;
65 }
66
67 unsigned long MasterGO::Gold(void) const
68 {
69 return mGold;
70 }
71
72 void MasterGO::Health(const int &value)
73 {
74 mHealth = value;
75 }
76
77 int MasterGO::Health(void) const
78 {
79 return mHealth;
80 }
81
82 void MasterGO::MaxHealth(const int &value)
83 {
84 mMaxHealth = value;
85 }
86
87 int MasterGO::MaxHealth(void) const
88 {
89 return mMaxHealth;
90 }
91
92 void MasterGO::WeaponName(const string &value)
93 {
94 assert(!value.empty());
95 mWeaponName = value;
96 }
97
98 string MasterGO::WeaponName(void) const
99 {
100 return mWeaponName;
101 }
102
103 void MasterGO::DeathCry(const string &value)
104 {
105 assert(!value.empty());
106 mDeathCry = value;
107 }
108
109 string MasterGO::DeathCry(void) const
110 {
111 return mDeathCry;
112 }
113
114 bool MasterGO::operator==(const MasterGO &right) const
115 {
116 return mId == right.mId && mHealth == right.mHealth &&
117 mDefense == right.mDefense && mDeathCry == right.mDeathCry &&
118 mGold == right.mGold && mHealth == right.mHealth &&
119 mMaxHealth == right.mMaxHealth && mName == right.mName &&
120 mStrength == right.mStrength && mWeaponName == right.mWeaponName;
121 }
122
123 bool MasterGO::operator!=(const MasterGO &right) const
124 {
125 return (!(*this == right));
126 }
127
128 ObjectTypes::ObjectType MasterGO::ObjectType(void) const
129 {
130 return ObjectTypes::Master;
131 }
132