]> jfr.im git - irc/gameservirc.git/blob - gameserv-2.0/libgameservgldl/include/GameServ/GameLayer/GameObjects/PlayerGO.h
Added a FileWeaponDAO which is basically the same as the FileArmorDAO
[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
23 #include <boost/date_time/posix_time/posix_time.hpp>
24 using boost::posix_time::ptime;
25
26 namespace GameServ { namespace GameLayer { namespace GameObjects
27 {
28 class PlayerGO : public GameObject
29 {
30 public:
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 //! Use an Item
102 void Use(shared_ptr<ItemGO> spItem);
103 //! Undo the effects of an item
104 void Undo(shared_ptr<ItemGO> spItem);
105
106 //! Property set - Password
107 void Password(const string &value);
108 //! Property get - Password
109 string Password(void) const;
110
111 //! Property set - LastLogin
112 void LastLogin(const ptime &value);
113 //! Property get - LastLogin
114 ptime LastLogin(void) const;
115
116 //! Property get - FoughtMaster
117 bool FoughtMaster(void) const;
118
119 //! Property set - Fought master
120 void FoughtMaster(const bool &value);
121
122 //! Property get - Alive
123 bool Alive(void) const;
124
125 //! Property set - Alive
126 void Alive(const bool &value);
127
128 bool operator==(const PlayerGO &right) const;
129 bool operator!=(const PlayerGO &right) const;
130
131 virtual PlayerGO *Clone(void) const;
132
133 private:
134 string mName;
135 int mLevel;
136 unsigned long int mExperience;
137 unsigned long int mGold;
138 unsigned long int mBank;
139 int mHealth;
140 int mMaxHealth;
141 int mStrength;
142 int mDefense;
143 int mForestFights;
144 int mPlayerFights;
145 string mPassword;
146 shared_ptr<WeaponGO> mWeapon;
147 shared_ptr<ArmorGO> mArmor;
148 vector< shared_ptr<ItemGO> > mInventory;
149 ptime mLastLogin;
150
151 bool mFoughtMaster;
152 bool mAlive;
153 };
154 }}} // GameServ::GameLayer::GameObjects
155 #endif