]>
jfr.im git - irc/gameservirc.git/blob - gameserv-2.0/libgameservgldl/include/GameServ/GameLayer/GameObjects/PlayerGO.h
cf21f495919663e90f8e57875c327994ee5d6cfc
1 #ifndef __GS__PLAYER_H__
2 #define __GS__PLAYER_H__
3 #include <GameServ/GameLayer/GameObjects/GameObject.h>
4 using GameServ::GameLayer::GameObjects::GameObject
;
6 #include <GameServ/GameLayer/GameObjects/ItemGO.h>
7 using GameServ::GameLayer::GameObjects::ItemGO
;
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
;
14 #include <GameServ/Types.h>
15 using GameServ::Types::ObjectTypes
;
17 #include <boost/smart_ptr/shared_ptr.hpp>
18 using boost::shared_ptr
;
25 #include <boost/date_time/posix_time/posix_time.hpp>
26 using boost::posix_time::ptime
;
28 namespace GameServ
{ namespace GameLayer
{ namespace GameObjects
30 class PlayerGO
: public GameObject
35 PlayerGO(const string
&Id
);
39 //! Property get - Name
40 string
Name(void) const;
41 //! Property set - Name
42 void Name(const string
&value
);
44 //! Property get - Level
45 int Level(void) const;
46 //! Property set - Level
47 void Level(const int &value
);
49 //! Property get - Experience
50 unsigned long int Experience(void) const;
51 //! Property set - Experience
52 void Experience(const unsigned long int &value
);
54 //! Property get - Gold
55 unsigned long int Gold(void) const;
56 //! Property set - Gold
57 void Gold(const unsigned long int &value
);
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
);
64 //! Property get - Health
65 int Health(void) const;
66 //! Property set - Health
67 void Health(const int &value
);
69 //! Property get - Max Health
70 int MaxHealth(void) const;
71 //! Property set - Max Health
72 void MaxHealth(const int &value
);
74 //! Property get - Strength
75 int Strength(void) const;
76 //! Property set - Strength
77 void Strength(const int &value
);
79 //! Property get - Defense
80 int Defense(void) const;
81 //! Property set - Defense
82 void Defense(const int &value
);
84 //! Property get - Forest Fights
85 int ForestFights(void) const;
86 //! Propety set - Forest Fights
87 void ForestFights(const int &value
);
89 //! Property get - Player Fights
90 int PlayerFights(void) const;
91 //! Property set - Player Fights
92 void PlayerFights(const int &value
);
94 //! Property get - Weapon
95 shared_ptr
<WeaponGO
> Weapon(void) const;
96 //! Property set - Weapon
97 void Weapon(shared_ptr
<WeaponGO
> spWeapon
);
99 //! Property get - Armor
100 shared_ptr
<ArmorGO
> Armor(void) const;
101 //! Property set - Armor
102 void Armor(shared_ptr
<ArmorGO
> spArmor
);
104 //! Property set - Password
105 void Password(const string
&value
);
106 //! Property get - Password
107 string
Password(void) const;
109 //! Property set - LastLogin
110 void LastLogin(const ptime
&value
);
111 //! Property get - LastLogin
112 ptime
LastLogin(void) const;
114 //! Property get - FoughtMaster
115 bool FoughtMaster(void) const;
117 //! Property set - Fought master
118 void FoughtMaster(const bool &value
);
120 //! Property get - Alive
121 bool Alive(void) const;
123 //! Property set - Alive
124 void Alive(const bool &value
);
126 //! Property set - Inventory
127 void Inventory(const vector
< shared_ptr
<ItemGO
> > &items
);
129 //! Property get - Inventory
130 vector
< shared_ptr
<ItemGO
> > Inventory(void) const;
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);
137 bool operator==(const PlayerGO
&right
) const;
138 bool operator!=(const PlayerGO
&right
) const;
140 virtual PlayerGO
*Clone(void) const;
142 virtual ObjectTypes::ObjectType
ObjectType(void) const;
147 unsigned long int mExperience
;
148 unsigned long int mGold
;
149 unsigned long int mBank
;
157 shared_ptr
<WeaponGO
> mWeapon
;
158 shared_ptr
<ArmorGO
> mArmor
;
164 vector
< shared_ptr
<ItemGO
> > mItems
;
166 shared_ptr
<ItemGO
> CloneItemAsProperType(shared_ptr
<ItemGO
> spItem
) const;
168 }}} // GameServ::GameLayer::GameObjects