diff options
author | Jared Adams <jaxad0127@gmail.com> | 2010-03-25 16:03:13 -0600 |
---|---|---|
committer | Jared Adams <jaxad0127@gmail.com> | 2010-03-25 16:56:12 -0600 |
commit | 8745368108563d7c32820b989c3ea794ccb834f9 (patch) | |
tree | a69554b2e5659b25f50797cc6ab4cc95b2b6f84e /src/inventory.h | |
parent | ac18a72c9972faf6dbd68abf3c883b2d444396c8 (diff) | |
download | mana-8745368108563d7c32820b989c3ea794ccb834f9.tar.gz mana-8745368108563d7c32820b989c3ea794ccb834f9.tar.bz2 mana-8745368108563d7c32820b989c3ea794ccb834f9.tar.xz mana-8745368108563d7c32820b989c3ea794ccb834f9.zip |
Remove the type boolean from InventoryWindow
This moves inventory/storage type into the Inventory class, having
size default to a call to the netcode to get the sive for the given
type.
Reviewed-by: Chuck Miller
Diffstat (limited to 'src/inventory.h')
-rw-r--r-- | src/inventory.h | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/inventory.h b/src/inventory.h index 0529d504..0ee516d6 100644 --- a/src/inventory.h +++ b/src/inventory.h @@ -43,12 +43,20 @@ class Inventory public: static const int NO_SLOT_INDEX = -1; /**< Slot has no index. */ + enum { + INVENTORY, + STORAGE, + TRADE, + TYPE_END + }; + + /** * Constructor. * * @param size the number of items that fit in the inventory */ - Inventory(int size); + Inventory(int type, int size = -1); /** * Destructor. @@ -123,12 +131,19 @@ class Inventory void removeInventoyListener(InventoryListener* listener); + int getType() const + { return mType; } + + bool isMainInventory() const + { return mType == INVENTORY; } + protected: typedef std::list<InventoryListener*> InventoryListenerList; InventoryListenerList mInventoryListeners; void distributeSlotsChangedEvent(); + int mType; Item **mItems; /**< The holder of items */ int mSize; /**< The max number of inventory items */ int mUsed; /**< THe number of slots in use */ |