]> jfr.im git - irc/gameservirc.git/blob - gameserv-2.0/libgameservgldl/include/GameServ/GameLayer/GameObjects/PlayerGO.h
Changed all modifiers to be ranges. A single number is now treated as a range of...
[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 <boost/smart_ptr/shared_ptr.hpp>
15 using boost::shared_ptr;
16
17 #include <string>
18 using std::string;
19 #include <vector>
20 using std::vector;
21
22 #include <boost/date_time/posix_time/posix_time.hpp>
23 using boost::posix_time::ptime;
24
25 namespace GameServ { namespace GameLayer { namespace GameObjects
26 {
27 class PlayerGO : public GameObject
28 {
29 public:
30
31 PlayerGO();
32 PlayerGO(const string &Id);
33
34 virtual ~PlayerGO();
35
36 //! Property get - Name
37 string Name(void) const;
38 //! Property set - Name
39 void Name(const string &value);
40
41 //! Property get - Level
42 int Level(void) const;
43 //! Property set - Level
44 void Level(const int &value);
45
46 //! Property get - Experience
47 unsigned long int Experience(void) const;
48 //! Property set - Experience
49 void Experience(const unsigned long int &value);
50
51 //! Property get - Gold
52 unsigned long int Gold(void) const;
53 //! Property set - Gold
54 void Gold(const unsigned long int &value);
55
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);
60
61 //! Property get - Health
62 int Health(void) const;
63 //! Property set - Health
64 void Health(const int &value);
65
66 //! Property get - Max Health
67 int MaxHealth(void) const;
68 //! Property set - Max Health
69 void MaxHealth(const int &value);
70
71 //! Property get - Strength
72 int Strength(void) const;
73 //! Property set - Strength
74 void Strength(const int &value);
75
76 //! Property get - Defense
77 int Defense(void) const;
78 //! Property set - Defense
79 void Defense(const int &value);
80
81 //! Property get - Forest Fights
82 int ForestFights(void) const;
83 //! Propety set - Forest Fights
84 void ForestFights(const int &value);
85
86 //! Property get - Player Fights
87 int PlayerFights(void) const;
88 //! Property set - Player Fights
89 void PlayerFights(const int &value);
90
91 //! Property get - Weapon
92 shared_ptr<WeaponGO> Weapon(void) const;
93 //! Property set - Weapon
94 void Weapon(shared_ptr<WeaponGO> spWeapon);
95
96 //! Property get - Armor
97 shared_ptr<ArmorGO> Armor(void) const;
98 //! Property set - Armor
99 void Armor(shared_ptr<ArmorGO> spArmor);
100
101 //! Property set - Password
102 void Password(const string &value);
103 //! Property get - Password
104 string Password(void) const;
105
106 //! Property set - LastLogin
107 void LastLogin(const ptime &value);
108 //! Property get - LastLogin
109 ptime LastLogin(void) const;
110
111 //! Property get - FoughtMaster
112 bool FoughtMaster(void) const;
113
114 //! Property set - Fought master
115 void FoughtMaster(const bool &value);
116
117 //! Property get - Alive
118 bool Alive(void) const;
119
120 //! Property set - Alive
121 void Alive(const bool &value);
122
123 //! Property set - Inventory
124 void Inventory(const vector< shared_ptr<ItemGO> > &items);
125
126 //! Property get - Inventory
127 vector< shared_ptr<ItemGO> > Inventory(void) const;
128
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);
133
134 bool operator==(const PlayerGO &right) const;
135 bool operator!=(const PlayerGO &right) const;
136
137 virtual PlayerGO *Clone(void) const;
138
139 private:
140 string mName;
141 int mLevel;
142 unsigned long int mExperience;
143 unsigned long int mGold;
144 unsigned long int mBank;
145 int mHealth;
146 int mMaxHealth;
147 int mStrength;
148 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 vector< shared_ptr<ItemGO> > mItems;
160 };
161 }}} // GameServ::GameLayer::GameObjects
162 #endif