]> jfr.im git - irc/gameservirc.git/blame - gameserv-2.0/libgameservgldl/include/GameServ/GameLayer/GameObjects/PlayerGO.h
Made FilePlayerDAO::Insert() only append a line instead of writing the whole file...
[irc/gameservirc.git] / gameserv-2.0 / libgameservgldl / include / GameServ / GameLayer / GameObjects / PlayerGO.h
CommitLineData
4534c364 1#ifndef __GS__PLAYER_H__\r
2#define __GS__PLAYER_H__\r
3#include <GameServ/GameLayer/GameObjects/GameObject.h>\r
4using GameServ::GameLayer::GameObjects::GameObject;\r
5\r
551b6a1d 6#include <GameServ/GameLayer/GameObjects/ItemGO.h>\r
7using GameServ::GameLayer::GameObjects::ItemGO;\r
8\r
9#include <GameServ/GameLayer/GameObjects/ArmorGO.h>\r
551b6a1d 10using GameServ::GameLayer::GameObjects::ArmorGO;\r
07e8dab5 11#include <GameServ/GameLayer/GameObjects/WeaponGO.h>\r
551b6a1d 12using GameServ::GameLayer::GameObjects::WeaponGO;\r
13\r
4534c364 14#include <boost/shared_ptr.hpp>\r
15using boost::shared_ptr;\r
16\r
17#include <string>\r
18using std::string;\r
551b6a1d 19#include <vector>\r
20using std::vector;\r
4534c364 21\r
77a55fd1 22\r
23#include <boost/date_time/posix_time/posix_time.hpp>\r
24using boost::posix_time::ptime;\r
25\r
4534c364 26namespace GameServ { namespace GameLayer { namespace GameObjects\r
27{\r
28 class PlayerGO : public GameObject\r
29 {\r
30 public:\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
551b6a1d 101 //! Use an Item\r
102 void Use(shared_ptr<ItemGO> spItem);\r
ce4e8c42 103 //! Undo the effects of an item\r
104 void Undo(shared_ptr<ItemGO> spItem);\r
105\r
2a8a990d 106 //! Property set - Password\r
107 void Password(const string &value);\r
108 //! Property get - Password\r
109 string Password(void) const;\r
110\r
77a55fd1 111 //! Property set - LastLogin\r
112 void LastLogin(const ptime &value);\r
113 //! Property get - LastLogin\r
114 ptime LastLogin(void) const;\r
115\r
eec695cf 116 // TODO: Add boolean flags\r
117\r
ce4e8c42 118 bool operator==(const PlayerGO &right) const;\r
119 bool operator!=(const PlayerGO &right) const;\r
120\r
121 virtual PlayerGO *Clone(void) const;\r
4534c364 122\r
123 private:\r
124 string mName;\r
125 int mLevel;\r
126 unsigned long int mExperience;\r
127 unsigned long int mGold;\r
2a8a990d 128 unsigned long int mBank;\r
4534c364 129 int mHealth;\r
130 int mMaxHealth;\r
131 int mStrength;\r
132 int mDefense;\r
133 int mForestFights;\r
134 int mPlayerFights;\r
135 string mPassword;\r
136 shared_ptr<WeaponGO> mWeapon;\r
137 shared_ptr<ArmorGO> mArmor;\r
551b6a1d 138 vector< shared_ptr<ItemGO> > mInventory;\r
77a55fd1 139 ptime mLastLogin;\r
eec695cf 140\r
141 // TODO: Add flag long int\r
4534c364 142 };\r
143}}} // GameServ::GameLayer::GameObjects\r
144#endif