]>
jfr.im git - irc/gameservirc.git/blob - 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
;
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 <boost/smart_ptr/shared_ptr.hpp>
15 using boost::shared_ptr
;
22 #include <boost/date_time/posix_time/posix_time.hpp>
23 using boost::posix_time::ptime
;
25 namespace GameServ
{ namespace GameLayer
{ namespace GameObjects
27 class PlayerGO
: public GameObject
32 PlayerGO(const string
&Id
);
36 //! Property get - Name
37 string
Name(void) const;
38 //! Property set - Name
39 void Name(const string
&value
);
41 //! Property get - Level
42 int Level(void) const;
43 //! Property set - Level
44 void Level(const int &value
);
46 //! Property get - Experience
47 unsigned long int Experience(void) const;
48 //! Property set - Experience
49 void Experience(const unsigned long int &value
);
51 //! Property get - Gold
52 unsigned long int Gold(void) const;
53 //! Property set - Gold
54 void Gold(const unsigned long int &value
);
56 //! Property get - Gold in the bank
57 unsigned long int Bank(void) const;
58 //! Property set - Gold in the bank
59 void Bank(const unsigned long int &value
);
61 //! Property get - Health
62 int Health(void) const;
63 //! Property set - Health
64 void Health(const int &value
);
66 //! Property get - Max Health
67 int MaxHealth(void) const;
68 //! Property set - Max Health
69 void MaxHealth(const int &value
);
71 //! Property get - Strength
72 int Strength(void) const;
73 //! Property set - Strength
74 void Strength(const int &value
);
76 //! Property get - Defense
77 int Defense(void) const;
78 //! Property set - Defense
79 void Defense(const int &value
);
81 //! Property get - Forest Fights
82 int ForestFights(void) const;
83 //! Propety set - Forest Fights
84 void ForestFights(const int &value
);
86 //! Property get - Player Fights
87 int PlayerFights(void) const;
88 //! Property set - Player Fights
89 void PlayerFights(const int &value
);
91 //! Property get - Weapon
92 shared_ptr
<WeaponGO
> Weapon(void) const;
93 //! Property set - Weapon
94 void Weapon(shared_ptr
<WeaponGO
> spWeapon
);
96 //! Property get - Armor
97 shared_ptr
<ArmorGO
> Armor(void) const;
98 //! Property set - Armor
99 void Armor(shared_ptr
<ArmorGO
> spArmor
);
101 //! Property set - Password
102 void Password(const string
&value
);
103 //! Property get - Password
104 string
Password(void) const;
106 //! Property set - LastLogin
107 void LastLogin(const ptime
&value
);
108 //! Property get - LastLogin
109 ptime
LastLogin(void) const;
111 //! Property get - FoughtMaster
112 bool FoughtMaster(void) const;
114 //! Property set - Fought master
115 void FoughtMaster(const bool &value
);
117 //! Property get - Alive
118 bool Alive(void) const;
120 //! Property set - Alive
121 void Alive(const bool &value
);
123 //! Property set - Inventory
124 void Inventory(const vector
< shared_ptr
<ItemGO
> > &items
);
126 //! Property get - Inventory
127 vector
< shared_ptr
<ItemGO
> > Inventory(void) const;
129 //! Add item to inventory
130 void AddItemToInventory(shared_ptr
<ItemGO
> spItem
, const int &Number
=1);
131 //! Remove item from inventory
132 void RemoveItemFromInventory(shared_ptr
<ItemGO
> spItem
, const int &Number
=1);
134 bool operator==(const PlayerGO
&right
) const;
135 bool operator!=(const PlayerGO
&right
) const;
137 virtual PlayerGO
*Clone(void) const;
142 unsigned long int mExperience
;
143 unsigned long int mGold
;
144 unsigned long int mBank
;
152 shared_ptr
<WeaponGO
> mWeapon
;
153 shared_ptr
<ArmorGO
> mArmor
;
159 vector
< shared_ptr
<ItemGO
> > mItems
;
161 }}} // GameServ::GameLayer::GameObjects