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.cpp | |
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.cpp')
-rw-r--r-- | src/inventory.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/inventory.cpp b/src/inventory.cpp index 8a6e79bb..a6038c85 100644 --- a/src/inventory.cpp +++ b/src/inventory.cpp @@ -23,6 +23,9 @@ #include "item.h" #include "log.h" +#include "net/inventoryhandler.h" +#include "net/net.h" + #include <algorithm> struct SlotUsed : public std::unary_function<Item*, bool> @@ -33,8 +36,9 @@ struct SlotUsed : public std::unary_function<Item*, bool> } }; -Inventory::Inventory(int size): - mSize(size), +Inventory::Inventory(int type, int size): + mType(type), + mSize(size == -1 ? Net::getInventoryHandler()->getSize(type) : size), mUsed(0) { mItems = new Item*[mSize]; |