]> jfr.im git - irc/gameservirc.git/blob - gameserv-2.0/libgameservgldl/include/GameServ/GameLayer/GameObjects/PlayerGO.h
cf21f495919663e90f8e57875c327994ee5d6cfc
[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 - Level
45 int Level(void) const;
46 //! Property set - Level
47 void Level(const int &value);
48
49 //! Property get - Experience
50 unsigned long int Experience(void) const;
51 //! Property set - Experience
52 void Experience(const unsigned long int &value);
53
54 //! Property get - Gold
55 unsigned long int Gold(void) const;
56 //! Property set - Gold
57 void Gold(const unsigned long int &value);
58
59 //! Property get - Gold in the bank
60 unsigned long int Bank(void) const;
61 //! Property set - Gold in the bank
62 void Bank(const unsigned long int &value);
63
64 //! Property get - Health
65 int Health(void) const;
66 //! Property set - Health
67 void Health(const int &value);
68
69 //! Property get - Max Health
70 int MaxHealth(void) const;
71 //! Property set - Max Health
72 void MaxHealth(const int &value);
73
74 //! Property get - Strength
75 int Strength(void) const;
76 //! Property set - Strength
77 void Strength(const int &value);
78
79 //! Property get - Defense
80 int Defense(void) const;
81 //! Property set - Defense
82 void Defense(const int &value);
83
84 //! Property get - Forest Fights
85 int ForestFights(void) const;
86 //! Propety set - Forest Fights
87 void ForestFights(const int &value);
88
89 //! Property get - Player Fights
90 int PlayerFights(void) const;
91 //! Property set - Player Fights
92 void PlayerFights(const int &value);
93
94 //! Property get - Weapon
95 shared_ptr<WeaponGO> Weapon(void) const;
96 //! Property set - Weapon
97 void Weapon(shared_ptr<WeaponGO> spWeapon);
98
99 //! Property get - Armor
100 shared_ptr<ArmorGO> Armor(void) const;
101 //! Property set - Armor
102 void Armor(shared_ptr<ArmorGO> spArmor);
103
104 //! Property set - Password
105 void Password(const string &value);
106 //! Property get - Password
107 string Password(void) const;
108
109 //! Property set - LastLogin
110 void LastLogin(const ptime &value);
111 //! Property get - LastLogin
112 ptime LastLogin(void) const;
113
114 //! Property get - FoughtMaster
115 bool FoughtMaster(void) const;
116
117 //! Property set - Fought master
118 void FoughtMaster(const bool &value);
119
120 //! Property get - Alive
121 bool Alive(void) const;
122
123 //! Property set - Alive
124 void Alive(const bool &value);
125
126 //! Property set - Inventory
127 void Inventory(const vector< shared_ptr<ItemGO> > &items);
128
129 //! Property get - Inventory
130 vector< shared_ptr<ItemGO> > Inventory(void) const;
131
132 //! Add item to inventory
133 void AddItemToInventory(shared_ptr<ItemGO> spItem, const int &Number=1);
134 //! Remove item from inventory
135 void RemoveItemFromInventory(shared_ptr<ItemGO> spItem, const int &Number=1);
136
137 bool operator==(const PlayerGO &right) const;
138 bool operator!=(const PlayerGO &right) const;
139
140 virtual PlayerGO *Clone(void) const;
141
142 virtual ObjectTypes::ObjectType ObjectType(void) const;
143
144 private:
145 string mName;
146 int mLevel;
147 unsigned long int mExperience;
148 unsigned long int mGold;
149 unsigned long int mBank;
150 int mHealth;
151 int mMaxHealth;
152 int mStrength;
153 int mDefense;
154 int mForestFights;
155 int mPlayerFights;
156 string mPassword;
157 shared_ptr<WeaponGO> mWeapon;
158 shared_ptr<ArmorGO> mArmor;
159 ptime mLastLogin;
160
161 bool mFoughtMaster;
162 bool mAlive;
163
164 vector< shared_ptr<ItemGO> > mItems;
165
166 shared_ptr<ItemGO> CloneItemAsProperType(shared_ptr<ItemGO> spItem) const;
167 };
168 }}} // GameServ::GameLayer::GameObjects
169 #endif