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/net/manaserv | |
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/net/manaserv')
-rw-r--r-- | src/net/manaserv/inventoryhandler.cpp | 18 | ||||
-rw-r--r-- | src/net/manaserv/inventoryhandler.h | 10 |
2 files changed, 14 insertions, 14 deletions
diff --git a/src/net/manaserv/inventoryhandler.cpp b/src/net/manaserv/inventoryhandler.cpp index 66f4a2ba..76fca7ae 100644 --- a/src/net/manaserv/inventoryhandler.cpp +++ b/src/net/manaserv/inventoryhandler.cpp @@ -79,7 +79,7 @@ void InventoryHandler::handleMessage(Net::MessageIn &msg) { mEquips.setEquipment(slot, id); } - else if (slot >= 32 && slot < 32 + getSize(INVENTORY)) + else if (slot >= 32 && slot < 32 + getSize(Inventory::INVENTORY)) { int amount = id ? msg.readInt8() : 0; player_node->setInvItem(slot - 32, id, amount); @@ -154,30 +154,30 @@ void InventoryHandler::moveItem(int oldIndex, int newIndex) gameServerConnection->send(msg); } -void InventoryHandler::openStorage(StorageType type) +void InventoryHandler::openStorage(int type) { // TODO } -void InventoryHandler::closeStorage(StorageType type) +void InventoryHandler::closeStorage(int type) { // TODO } -void InventoryHandler::moveItem(StorageType source, int slot, int amount, - StorageType destination) +void InventoryHandler::moveItem(int source, int slot, int amount, + int destination) { // TODO } -size_t InventoryHandler::getSize(StorageType type) const +size_t InventoryHandler::getSize(int type) const { switch (type) { - case INVENTORY: + case Inventory::INVENTORY: + case Inventory::TRADE: return 50; - case STORAGE: - case GUILD_STORAGE: + case Inventory::STORAGE: return 300; default: return 0; diff --git a/src/net/manaserv/inventoryhandler.h b/src/net/manaserv/inventoryhandler.h index 49f013cf..fd08b95e 100644 --- a/src/net/manaserv/inventoryhandler.h +++ b/src/net/manaserv/inventoryhandler.h @@ -88,14 +88,14 @@ class InventoryHandler : public MessageHandler, Net::InventoryHandler void moveItem(int oldIndex, int newIndex); - void openStorage(StorageType type); + void openStorage(int type); - void closeStorage(StorageType type); + void closeStorage(int type); - void moveItem(StorageType source, int slot, int amount, - StorageType destination); + void moveItem(int source, int slot, int amount, + int destination); - size_t getSize(StorageType type) const; + size_t getSize(int type) const; private: EquipBackend mEquips; |