diff options
author | Yohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer> | 2011-08-19 02:37:09 +0200 |
---|---|---|
committer | Yohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer> | 2011-08-19 02:37:09 +0200 |
commit | 27114fa2694318f2a1c56cb828a3b79731efcb74 (patch) | |
tree | aad31af84a5932bf8fda83e367dfa1ac78fec1c3 /src/net/manaserv/inventoryhandler.h | |
parent | 36239b2d689b862a951a65a9be7376a500f1ace9 (diff) | |
download | mana-27114fa2694318f2a1c56cb828a3b79731efcb74.tar.gz mana-27114fa2694318f2a1c56cb828a3b79731efcb74.tar.bz2 mana-27114fa2694318f2a1c56cb828a3b79731efcb74.tar.xz mana-27114fa2694318f2a1c56cb828a3b79731efcb74.zip |
Fixed visible equipment updates, and made it based on equip.xml.
Diffstat (limited to 'src/net/manaserv/inventoryhandler.h')
-rw-r--r-- | src/net/manaserv/inventoryhandler.h | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/src/net/manaserv/inventoryhandler.h b/src/net/manaserv/inventoryhandler.h index aed41d6c..bf3022ab 100644 --- a/src/net/manaserv/inventoryhandler.h +++ b/src/net/manaserv/inventoryhandler.h @@ -51,8 +51,14 @@ class EquipBackend : public Equipment::Backend, public EventListener int getSlotNumber() const { return mSlots.size(); } + unsigned int getVisibleSlotsNumber() const + { return mVisibleSlots; } + void triggerUnequip(int slotIndex) const; + bool isWeaponSlot(int slotTypeId) const; + bool isAmmoSlot(int slotTypeId) const; + private: void readEquipFile(); @@ -61,7 +67,9 @@ class EquipBackend : public Equipment::Backend, public EventListener item(0), slotTypeId(0), subId(0), - itemInstance(0) + itemInstance(0), + weaponSlot(false), + ammoSlot(false) {} // Generic info @@ -86,8 +94,16 @@ class EquipBackend : public Equipment::Backend, public EventListener // This is the (per character) unique item Id, used especially when // equipping the same item multiple times on the same slot type. unsigned int itemInstance; + + // Tell whether the slot is a weapon slot + bool weaponSlot; + + // Tell whether the slot is an ammo slot + bool ammoSlot; }; + unsigned int mVisibleSlots; + // slot client index, slot info typedef std::map<unsigned int, Slot> Slots; Slots mSlots; @@ -107,6 +123,15 @@ class InventoryHandler : public MessageHandler, Net::InventoryHandler, size_t getSize(int type) const; + bool isWeaponSlot(unsigned int slotTypeId) const + { return mEquipBackend.isWeaponSlot(slotTypeId); } + + bool isAmmoSlot(unsigned int slotTypeId) const + { return mEquipBackend.isAmmoSlot(slotTypeId); } + + unsigned int getVisibleSlotsNumber() const + { return mEquipBackend.getVisibleSlotsNumber(); } + private: EquipBackend mEquipBackend; }; |