]>
Commit | Line | Data |
---|---|---|
1 | #ifndef __GS__ITEM_H__\r | |
2 | #define __GS__ITEM_H__\r | |
3 | #include <GameServ/GameLayer/GameObjects/GameObject.h>\r | |
4 | using GameServ::GameLayer::GameObjects::GameObject;\r | |
5 | #include <GameServ/Types.h>\r | |
6 | using GameServ::Types::ItemTypes;\r | |
7 | using GameServ::Types::Modifiers;\r | |
8 | using GameServ::Types::IntRange;\r | |
9 | using GameServ::Types::ObjectTypes;\r | |
10 | \r | |
11 | #include <string>\r | |
12 | using std::string;\r | |
13 | #include <map>\r | |
14 | using std::map;\r | |
15 | \r | |
16 | namespace GameServ { namespace GameLayer { namespace GameObjects {\r | |
17 | \r | |
18 | class ItemGO : public GameObject\r | |
19 | {\r | |
20 | public:\r | |
21 | ItemGO();\r | |
22 | virtual ~ItemGO();\r | |
23 | \r | |
24 | //! Property get - Number\r | |
25 | unsigned long long Number(void) const;\r | |
26 | \r | |
27 | //! Property set - Number\r | |
28 | void Number(const unsigned long long &value);\r | |
29 | \r | |
30 | //! Property get - Name\r | |
31 | string Name(void) const;\r | |
32 | //! Property set - Name\r | |
33 | void Name(const string &value);\r | |
34 | \r | |
35 | //! Property get - Price\r | |
36 | unsigned long int Price(void) const;\r | |
37 | //! Property set - Price\r | |
38 | void Price(const unsigned long int &value);\r | |
39 | \r | |
40 | //! Property get - Uses\r | |
41 | int Uses(void) const;\r | |
42 | //! Property set - Uses\r | |
43 | void Uses(const int &value);\r | |
44 | \r | |
45 | //! Property get - Item Type\r | |
46 | virtual ItemTypes::ItemType Type(void) const = 0;\r | |
47 | \r | |
48 | //! Property get - Modifiers\r | |
49 | map<Modifiers::Modifier, IntRange> Modifiers(void) const;\r | |
50 | \r | |
51 | //! Property set - Modifiers\r | |
52 | void Modifiers(const map<Modifiers::Modifier, IntRange> &modifiers);\r | |
53 | \r | |
54 | //! Use item on a game object\r | |
55 | virtual void Use(boost::shared_ptr<GameObject> spObject);\r | |
56 | //! Undo item's last effect on a game object\r | |
57 | virtual void Undo(boost::shared_ptr<GameObject> spObject);\r | |
58 | \r | |
59 | virtual ItemGO *Clone(void) const = 0;\r | |
60 | \r | |
61 | virtual ObjectTypes::ObjectType ObjectType(void) const;\r | |
62 | \r | |
63 | protected:\r | |
64 | unsigned long long mNumber;\r | |
65 | string mName;\r | |
66 | unsigned long int mPrice;\r | |
67 | int mUses;\r | |
68 | map<Modifiers::Modifier, IntRange> mModifiers;\r | |
69 | \r | |
70 | //! Base class standard modifier applier. Simply adds the modified stat to the correct stat\r | |
71 | virtual void ApplyModifier(boost::shared_ptr<GameObject> spObject, const Modifiers::Modifier &modifier, IntRange);\r | |
72 | virtual void UndoModifier(boost::shared_ptr<GameObject> spObject, const Modifiers::Modifier &modifier, IntRange);\r | |
73 | };\r | |
74 | }}}\r | |
75 | #endif |