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