diff options
Diffstat (limited to 'src/item.h')
-rw-r--r-- | src/item.h | 20 |
1 files changed, 11 insertions, 9 deletions
@@ -26,6 +26,8 @@ #include "resources/itemdb.h" +class Image; + /** * Represents one or more instances of a certain item type. */ @@ -36,24 +38,18 @@ class Item * Constructor. */ Item(int id = -1, int quantity = 0, - bool equipment = false, bool equipped = false): - mId(id), - mQuantity(quantity), - mEquipment(equipment), - mEquipped(equipped) - { - } + bool equipment = false, bool equipped = false); /** * Destructor. */ - ~Item() {} + ~Item(); /** * Sets the item id, identifying the item type. */ void - setId(int id) { mId = id; } + setId(int id); /** * Returns the item id. @@ -62,6 +58,11 @@ class Item getId() const { return mId; } /** + * Returns the item image. + */ + Image* getImage() { return mImage; } + + /** * Sets the number of items. */ void @@ -123,6 +124,7 @@ class Item protected: int mId; /**< Item type id. */ + Image *mImage; /**< Item image. */ int mQuantity; /**< Number of items. */ bool mEquipment; /**< Item is equipment. */ bool mEquipped; /**< Item is equipped. */ |