summaryrefslogtreecommitdiff
path: root/src/item.h
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2008-06-12 09:06:01 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2008-06-12 09:06:01 +0000
commit2f8ee95fbacb71e7cbca85fcc11e6f9f7e36c258 (patch)
tree8d256ac1a38932aaf0db7b55ed178e4212616555 /src/item.h
parenteb019ab915998a3ec247b33dad4b23f763d7a29a (diff)
downloadMana-2f8ee95fbacb71e7cbca85fcc11e6f9f7e36c258.tar.gz
Mana-2f8ee95fbacb71e7cbca85fcc11e6f9f7e36c258.tar.bz2
Mana-2f8ee95fbacb71e7cbca85fcc11e6f9f7e36c258.tar.xz
Mana-2f8ee95fbacb71e7cbca85fcc11e6f9f7e36c258.zip
Merged revisions 3738 via svnmerge from
https://themanaworld.svn.sourceforge.net/svnroot/themanaworld/tmw/trunk ........ r3738 | b_lindeijer | 2007-11-16 00:44:01 +0100 (Fri, 16 Nov 2007) | 3 lines 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.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. */