]>
Commit | Line | Data |
---|---|---|
4534c364 | 1 | #ifndef __GS__PLAYER_H__\r |
2 | #define __GS__PLAYER_H__\r | |
3 | #include <GameServ/GameLayer/GameObjects/GameObject.h>\r | |
4 | using GameServ::GameLayer::GameObjects::GameObject;\r | |
5 | \r | |
551b6a1d | 6 | #include <GameServ/GameLayer/GameObjects/ItemGO.h>\r |
7 | using GameServ::GameLayer::GameObjects::ItemGO;\r | |
8 | \r | |
9 | #include <GameServ/GameLayer/GameObjects/ArmorGO.h>\r | |
551b6a1d | 10 | using GameServ::GameLayer::GameObjects::ArmorGO;\r |
07e8dab5 | 11 | #include <GameServ/GameLayer/GameObjects/WeaponGO.h>\r |
551b6a1d | 12 | using GameServ::GameLayer::GameObjects::WeaponGO;\r |
13 | \r | |
cce88913 | 14 | #include <boost/smart_ptr/shared_ptr.hpp>\r |
4534c364 | 15 | using boost::shared_ptr;\r |
16 | \r | |
17 | #include <string>\r | |
18 | using std::string;\r | |
551b6a1d | 19 | #include <vector>\r |
20 | using std::vector;\r | |
4534c364 | 21 | \r |
77a55fd1 | 22 | #include <boost/date_time/posix_time/posix_time.hpp>\r |
23 | using boost::posix_time::ptime;\r | |
24 | \r | |
4534c364 | 25 | namespace GameServ { namespace GameLayer { namespace GameObjects\r |
26 | {\r | |
27 | class PlayerGO : public GameObject\r | |
28 | {\r | |
29 | public:\r | |
317ce8de | 30 | \r |
551b6a1d | 31 | PlayerGO();\r |
ce4e8c42 | 32 | PlayerGO(const string &Id);\r |
33 | \r | |
34 | virtual ~PlayerGO();\r | |
4534c364 | 35 | \r |
36 | //! Property get - Name\r | |
37 | string Name(void) const;\r | |
38 | //! Property set - Name\r | |
39 | void Name(const string &value);\r | |
40 | \r | |
41 | //! Property get - Level\r | |
42 | int Level(void) const;\r | |
43 | //! Property set - Level\r | |
44 | void Level(const int &value);\r | |
45 | \r | |
46 | //! Property get - Experience\r | |
47 | unsigned long int Experience(void) const;\r | |
48 | //! Property set - Experience\r | |
49 | void Experience(const unsigned long int &value);\r | |
50 | \r | |
51 | //! Property get - Gold\r | |
52 | unsigned long int Gold(void) const;\r | |
53 | //! Property set - Gold\r | |
2a8a990d | 54 | void Gold(const unsigned long int &value);\r |
55 | \r | |
56 | //! Property get - Gold in the bank\r | |
57 | unsigned long int Bank(void) const;\r | |
58 | //! Property set - Gold in the bank\r | |
59 | void Bank(const unsigned long int &value);\r | |
4534c364 | 60 | \r |
61 | //! Property get - Health\r | |
62 | int Health(void) const;\r | |
63 | //! Property set - Health\r | |
64 | void Health(const int &value);\r | |
65 | \r | |
66 | //! Property get - Max Health\r | |
67 | int MaxHealth(void) const;\r | |
68 | //! Property set - Max Health\r | |
69 | void MaxHealth(const int &value);\r | |
70 | \r | |
71 | //! Property get - Strength\r | |
72 | int Strength(void) const;\r | |
73 | //! Property set - Strength\r | |
74 | void Strength(const int &value);\r | |
75 | \r | |
76 | //! Property get - Defense\r | |
77 | int Defense(void) const;\r | |
78 | //! Property set - Defense\r | |
79 | void Defense(const int &value);\r | |
80 | \r | |
81 | //! Property get - Forest Fights\r | |
82 | int ForestFights(void) const;\r | |
83 | //! Propety set - Forest Fights\r | |
84 | void ForestFights(const int &value);\r | |
85 | \r | |
86 | //! Property get - Player Fights\r | |
87 | int PlayerFights(void) const;\r | |
88 | //! Property set - Player Fights\r | |
89 | void PlayerFights(const int &value);\r | |
90 | \r | |
91 | //! Property get - Weapon\r | |
92 | shared_ptr<WeaponGO> Weapon(void) const;\r | |
93 | //! Property set - Weapon\r | |
551b6a1d | 94 | void Weapon(shared_ptr<WeaponGO> spWeapon);\r |
95 | \r | |
96 | //! Property get - Armor\r | |
97 | shared_ptr<ArmorGO> Armor(void) const;\r | |
98 | //! Property set - Armor\r | |
99 | void Armor(shared_ptr<ArmorGO> spArmor);\r | |
4534c364 | 100 | \r |
2a8a990d | 101 | //! Property set - Password\r |
102 | void Password(const string &value);\r | |
103 | //! Property get - Password\r | |
104 | string Password(void) const;\r | |
105 | \r | |
77a55fd1 | 106 | //! Property set - LastLogin\r |
107 | void LastLogin(const ptime &value);\r | |
108 | //! Property get - LastLogin\r | |
109 | ptime LastLogin(void) const;\r | |
110 | \r | |
cb255541 | 111 | //! Property get - FoughtMaster\r |
112 | bool FoughtMaster(void) const;\r | |
113 | \r | |
114 | //! Property set - Fought master\r | |
115 | void FoughtMaster(const bool &value);\r | |
116 | \r | |
117 | //! Property get - Alive\r | |
118 | bool Alive(void) const;\r | |
119 | \r | |
120 | //! Property set - Alive\r | |
121 | void Alive(const bool &value);\r | |
eec695cf | 122 | \r |
317ce8de | 123 | //! Property set - Inventory\r |
e823e42a | 124 | void Inventory(const vector< shared_ptr<ItemGO> > &items);\r |
317ce8de | 125 | \r |
126 | //! Property get - Inventory\r | |
e823e42a | 127 | vector< shared_ptr<ItemGO> > Inventory(void) const;\r |
317ce8de | 128 | \r |
129 | //! Add item to inventory\r | |
e823e42a | 130 | void AddItemToInventory(shared_ptr<ItemGO> spItem, const int &Number=1);\r |
317ce8de | 131 | //! Remove item from inventory\r |
e823e42a | 132 | void RemoveItemFromInventory(shared_ptr<ItemGO> spItem, const int &Number=1);\r |
317ce8de | 133 | \r |
ce4e8c42 | 134 | bool operator==(const PlayerGO &right) const;\r |
135 | bool operator!=(const PlayerGO &right) const;\r | |
136 | \r | |
137 | virtual PlayerGO *Clone(void) const;\r | |
4534c364 | 138 | \r |
139 | private:\r | |
140 | string mName;\r | |
141 | int mLevel;\r | |
142 | unsigned long int mExperience;\r | |
143 | unsigned long int mGold;\r | |
2a8a990d | 144 | unsigned long int mBank;\r |
4534c364 | 145 | int mHealth;\r |
146 | int mMaxHealth;\r | |
147 | int mStrength;\r | |
148 | int mDefense;\r | |
149 | int mForestFights;\r | |
150 | int mPlayerFights;\r | |
151 | string mPassword;\r | |
152 | shared_ptr<WeaponGO> mWeapon;\r | |
153 | shared_ptr<ArmorGO> mArmor;\r | |
77a55fd1 | 154 | ptime mLastLogin;\r |
eec695cf | 155 | \r |
cb255541 | 156 | bool mFoughtMaster;\r |
157 | bool mAlive;\r | |
317ce8de | 158 | \r |
e823e42a | 159 | vector< shared_ptr<ItemGO> > mItems;\r |
4534c364 | 160 | };\r |
161 | }}} // GameServ::GameLayer::GameObjects\r | |
162 | #endif |