summaryrefslogtreecommitdiff
path: root/src/gui/itemcontainer.h
diff options
context:
space:
mode:
authorBjörn Steinbrink <B.Steinbrink@gmx.de>2005-07-18 00:27:11 +0000
committerBjörn Steinbrink <B.Steinbrink@gmx.de>2005-07-18 00:27:11 +0000
commit290aab364a310b18bb02567f6e4e424d94148bf9 (patch)
tree13a860174c635db34e6087aa31c001386cbd6a7c /src/gui/itemcontainer.h
parent19b58f22f7e77382183c70d2b6a1c79b5e1584e7 (diff)
downloadmana-client-290aab364a310b18bb02567f6e4e424d94148bf9.tar.gz
mana-client-290aab364a310b18bb02567f6e4e424d94148bf9.tar.bz2
mana-client-290aab364a310b18bb02567f6e4e424d94148bf9.tar.xz
mana-client-290aab364a310b18bb02567f6e4e424d94148bf9.zip
Created Inventory class. (Really) Small code simplifications and cleanups.
Diffstat (limited to 'src/gui/itemcontainer.h')
-rw-r--r--src/gui/itemcontainer.h46
1 files changed, 3 insertions, 43 deletions
diff --git a/src/gui/itemcontainer.h b/src/gui/itemcontainer.h
index 6e72eba0..6def991a 100644
--- a/src/gui/itemcontainer.h
+++ b/src/gui/itemcontainer.h
@@ -28,13 +28,10 @@
#include <guichan.hpp>
#include "../item.h"
-
-#include "../item.h"
+#include "../inventory.h"
#include "../resources/image.h"
#include "../graphic/spriteset.h"
-#define INVENTORY_SIZE 100
-
/**
* An item container. Used to show items in inventory and trade dialog.
*
@@ -46,7 +43,7 @@ class ItemContainer : public gcn::Widget, public gcn::MouseListener
/**
* Constructor. Initializes the graphic.
*/
- ItemContainer();
+ ItemContainer(Inventory *inventory);
/**
* Destructor.
@@ -70,57 +67,20 @@ class ItemContainer : public gcn::Widget, public gcn::MouseListener
void mousePress(int mx, int my, int button);
/**
- * Finds the index of an item.
- */
- int getIndex(int id);
-
- /**
* Returns the selected item.
*/
Item* getItem();
/**
- * Returns the item at the specified index.
- */
- Item* getItem(int index);
-
- /**
- * Returns id of next free slot or -1 if all occupied.
- */
- int getFreeSlot();
-
- /**
- * Adds a new item.
- */
- void addItem(int index, int id, int quantity, bool equipment);
-
- /**
* Set selected item to -1.
*/
void selectNone();
- /**
- * Reset all item slots.
- */
- void resetItems();
-
- /**
- * Remove a item from the inventory.
- */
- void removeItem(int id);
-
- /**
- * Get the number of slots filled with an item
- */
- int getNumberOfSlotsUsed();
-
private:
+ Inventory *inventory;
Spriteset *itemset;
Image *selImg;
Item *selectedItem;
- int itemNumber;
- Item items[INVENTORY_SIZE]; /**< The holder of items */
-
};
#endif