summaryrefslogtreecommitdiff
path: root/src/item.h
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2007-11-15 23:44:01 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2007-11-15 23:44:01 +0000
commit0e925e97554aae573e895afa4e3d8450f01df342 (patch)
treebbc30319410aecb9fec7c005e667cd7fb628bb17 /src/item.h
parentffa0fae492d954c0aed35a0acbd7b856778d7328 (diff)
downloadmana-0e925e97554aae573e895afa4e3d8450f01df342.tar.gz
mana-0e925e97554aae573e895afa4e3d8450f01df342.tar.bz2
mana-0e925e97554aae573e895afa4e3d8450f01df342.tar.xz
mana-0e925e97554aae573e895afa4e3d8450f01df342.zip
Moved item icon from ItemInfo class to the Item class, so that it can be loaded
on demand. Results in faster startup time and reduced memory usage.
Diffstat (limited to 'src/item.h')
-rw-r--r--src/item.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/item.h b/src/item.h
index f5d0fc77..fc71e53d 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.
*/
@@ -38,6 +40,11 @@ class Item
Item(int id = 0, int quantity = 0);
/**
+ * Destructor.
+ */
+ ~Item();
+
+ /**
* Sets the item id, identifying the item type.
*/
void setId(int id);
@@ -49,6 +56,11 @@ class Item
getId() const { return mId; }
/**
+ * Returns the item image.
+ */
+ Image* getImage() { return mImage; }
+
+ /**
* Sets the number of items.
*/
void
@@ -92,6 +104,7 @@ class Item
protected:
int mId; /**< Item type id. */
+ Image *mImage; /**< Item image. */
int mQuantity; /**< Number of items. */
bool mEquipment; /**< Item is equipment. */
int mInvIndex; /**< Inventory index. */