]> jfr.im git - irc/gameservirc.git/blob - gameserv-2.0/libgameservgldl/include/GameServ/GameLayer/GameObjects/PlayerGO.h
I implemented a mock forest driver and found a problem in using the singleton design...
[irc/gameservirc.git] / gameserv-2.0 / libgameservgldl / include / GameServ / GameLayer / GameObjects / PlayerGO.h
1 #ifndef __GS__PLAYER_H__
2 #define __GS__PLAYER_H__
3 #include <GameServ/GameLayer/GameObjects/GameObject.h>
4 using GameServ::GameLayer::GameObjects::GameObject;
5
6 #include <GameServ/GameLayer/GameObjects/ItemGO.h>
7 using GameServ::GameLayer::GameObjects::ItemGO;
8
9 #include <GameServ/GameLayer/GameObjects/ArmorGO.h>
10 using GameServ::GameLayer::GameObjects::ArmorGO;
11 #include <GameServ/GameLayer/GameObjects/WeaponGO.h>
12 using GameServ::GameLayer::GameObjects::WeaponGO;
13
14 #include <GameServ/Types.h>
15 using GameServ::Types::ObjectTypes;
16
17 #include <boost/smart_ptr/shared_ptr.hpp>
18 using boost::shared_ptr;
19
20 #include <string>
21 using std::string;
22 #include <vector>
23 using std::vector;
24
25 #include <boost/date_time/posix_time/posix_time.hpp>
26 using boost::posix_time::ptime;
27
28 namespace GameServ { namespace GameLayer { namespace GameObjects
29 {
30 class PlayerGO : public GameObject
31 {
32 public:
33
34 PlayerGO();
35 PlayerGO(const string &Id);
36
37 virtual ~PlayerGO();
38
39 //! Property get - Name
40 string Name(void) const;
41 //! Property set - Name
42 void Name(const string &value);
43
44 //! Property get - LevelId
45 string LevelId(void) const;
46 //! Property set - LevelId
47 void LevelId(const string &value);
48
49 //! Property get - LevelNumber
50 unsigned int LevelNumber(void) const;
51 //! Property set - LevelNumber
52 void LevelNumber(const unsigned int &value);
53
54 //! Property get - Experience
55 unsigned long int Experience(void) const;
56 //! Property set - Experience
57 void Experience(const unsigned long int &value);
58
59 //! Property get - Gold
60 unsigned long int Gold(void) const;
61 //! Property set - Gold
62 void Gold(const unsigned long int &value);
63
64 //! Property get - Gold in the bank
65 unsigned long int Bank(void) const;
66 //! Property set - Gold in the bank
67 void Bank(const unsigned long int &value);
68
69 //! Property get - Health
70 unsigned int Health(void) const;
71 //! Property set - Health
72 void Health(const unsigned int &value);
73
74 //! Property get - Max Health
75 unsigned int MaxHealth(void) const;
76 //! Property set - Max Health
77 void MaxHealth(const unsigned int &value);
78
79 //! Property get - Strength
80 unsigned int Strength(void) const;
81 //! Property set - Strength
82 void Strength(const unsigned int &value);
83
84 //! Property get - Defense
85 unsigned int Defense(void) const;
86 //! Property set - Defense
87 void Defense(const unsigned int &value);
88
89 //! Property get - Forest Fights
90 int ForestFights(void) const;
91 //! Propety set - Forest Fights
92 void ForestFights(const int &value);
93
94 //! Property get - Player Fights
95 int PlayerFights(void) const;
96 //! Property set - Player Fights
97 void PlayerFights(const int &value);
98
99 //! Property get - Weapon
100 shared_ptr<WeaponGO> Weapon(void) const;
101 //! Property set - Weapon
102 void Weapon(shared_ptr<WeaponGO> spWeapon);
103
104 //! Property get - Armor
105 shared_ptr<ArmorGO> Armor(void) const;
106 //! Property set - Armor
107 void Armor(shared_ptr<ArmorGO> spArmor);
108
109 //! Property set - Password
110 void Password(const string &value);
111 //! Property get - Password
112 string Password(void) const;
113
114 //! Property set - LastLogin
115 void LastLogin(const ptime &value);
116 //! Property get - LastLogin
117 ptime LastLogin(void) const;
118
119 //! Property get - FoughtMaster
120 bool FoughtMaster(void) const;
121
122 //! Property set - Fought master
123 void FoughtMaster(const bool &value);
124
125 //! Property get - Alive
126 bool Alive(void) const;
127
128 //! Property set - Alive
129 void Alive(const bool &value);
130
131 bool operator==(const PlayerGO &right) const;
132 bool operator!=(const PlayerGO &right) const;
133
134 virtual PlayerGO *Clone(void) const;
135
136 virtual ObjectTypes::ObjectType ObjectType(void) const;
137
138 private:
139 string mName;
140 string mfkLevelId;
141 unsigned int mLevelNumber;
142 unsigned long int mExperience;
143 unsigned long int mGold;
144 unsigned long int mBank;
145 unsigned int mHealth;
146 unsigned int mMaxHealth;
147 unsigned int mStrength;
148 unsigned int mDefense;
149 int mForestFights;
150 int mPlayerFights;
151 string mPassword;
152 shared_ptr<WeaponGO> mWeapon;
153 shared_ptr<ArmorGO> mArmor;
154 ptime mLastLogin;
155
156 bool mFoughtMaster;
157 bool mAlive;
158 };
159 }}} // GameServ::GameLayer::GameObjects
160 #endif