diff options
Diffstat (limited to 'src/item.h')
-rw-r--r-- | src/item.h | 28 |
1 files changed, 14 insertions, 14 deletions
@@ -22,6 +22,8 @@ #ifndef ITEM_H #define ITEM_H +#include "event.h" + #include "resources/itemdb.h" class Image; @@ -35,8 +37,7 @@ class Item /** * Constructor. */ - Item(int id = -1, int quantity = 0, bool equipment = false, - bool equipped = false); + Item(int id = -1, int quantity = 0, bool equipped = false); /** * Destructor. @@ -79,16 +80,6 @@ class Item int getQuantity() const { return mQuantity; } /** - * Sets whether this item is considered equipment. - */ - void setEquipment(bool equipment) { mEquipment = equipment; } - - /** - * Returns whether this item is considered equipment. - */ - bool isEquipment() const { return mEquipment; } - - /** * Sets whether this item is equipped. */ void setEquipped(bool equipped) { mEquipped = equipped; } @@ -109,6 +100,11 @@ class Item bool isInEquipment() const { return mInEquipment; } /** + * Returns whether this item is equippable. + */ + bool isEquippable() const; + + /** * Sets the inventory index of this item. */ void setInvIndex(int index) { mInvIndex = index; } @@ -118,20 +114,24 @@ class Item */ int getInvIndex() const { return mInvIndex; } + void doEvent(Events eventName); + + void doEvent(Events eventName, int amount); + /** * Returns information about this item type. */ - const ItemInfo &getInfo() const { return ItemDB::get(mId); } + const ItemInfo &getInfo() const { return itemDb->get(mId); } protected: int mId; /**< Item type id. */ Image *mImage; /**< Item image. */ Image *mDrawImage; /**< Draw image. */ int mQuantity; /**< Number of items. */ - bool mEquipment; /**< Item is equipment. */ bool mEquipped; /**< Item is equipped. */ bool mInEquipment; /**< Item is in equipment */ int mInvIndex; /**< Inventory index. */ + }; #endif |