#define __GS__ITEM_H__\r
#include <GameServ/GameLayer/GameObjects/GameObject.h>\r
using GameServ::GameLayer::GameObjects::GameObject;\r
+#include <GameServ/Types.h>\r
+using GameServ::Types::ItemTypes;\r
+using GameServ::Types::Modifiers;\r
+using GameServ::Types::Range;\r
+using GameServ::Types::ObjectTypes;\r
\r
#include <string>\r
using std::string;\r
-#include <vector>\r
-using std::vector;\r
+#include <map>\r
+using std::map;\r
\r
namespace GameServ { namespace GameLayer { namespace GameObjects {\r
\r
- enum ItemType { NOTYPE, WEAPON, ARMOR, POTION };\r
-\r
class ItemGO : public GameObject\r
{\r
public:\r
ItemGO();\r
- ItemGO(const string &name, const unsigned long int &price, const int &uses, const vector<string> &modifiers);\r
virtual ~ItemGO();\r
\r
//! Property get - Name\r
void Uses(const int &value);\r
\r
//! Property get - Item Type\r
- ItemType Type(void) const;\r
-\r
- //! Property set - Item Type\r
- void Type(const ItemType &value);\r
+ virtual ItemTypes::ItemType Type(void) const = 0;\r
\r
//! Property get - Modifiers\r
- vector<string> Modifiers(void) const;\r
+ map<Modifiers::Modifier, Range> Modifiers(void) const;\r
+\r
//! Property set - Modifiers\r
- void Modifiers(const vector<string> &value);\r
+ void Modifiers(const map<Modifiers::Modifier, Range> &modifiers);\r
\r
- virtual ItemGO *Clone(void) const;\r
+ //! Use item on a game object\r
+ virtual void Use(shared_ptr<GameObject> spObject);\r
+ //! Undo item's last effect on a game object\r
+ virtual void Undo(shared_ptr<GameObject> spObject);\r
+\r
+ virtual ItemGO *Clone(void) const = 0;\r
+\r
+ virtual ObjectTypes::ObjectType ObjectType(void) const;\r
\r
protected:\r
string mName;\r
unsigned long int mPrice;\r
int mUses;\r
- ItemType mType;\r
- vector<string> mModifiers;\r
+ map<Modifiers::Modifier, Range> mModifiers;\r
+\r
+ //! Base class standard modifier applier. Simply adds the modified stat to the correct stat\r
+ virtual void ApplyModifier(shared_ptr<GameObject> spObject, const Modifiers::Modifier &modifier, Range r);\r
+ virtual void UndoModifier(shared_ptr<GameObject> spObject, const Modifiers::Modifier &modifier, Range r);\r
};\r
}}}\r
#endif
\ No newline at end of file