summaryrefslogtreecommitdiff
path: root/src/item.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/item.h')
-rw-r--r--src/item.h20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/item.h b/src/item.h
index 47cdb1a9..9e1c5ec8 100644
--- a/src/item.h
+++ b/src/item.h
@@ -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. */