summaryrefslogtreecommitdiff
path: root/src/net/manaserv/inventoryhandler.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/manaserv/inventoryhandler.h')
-rw-r--r--src/net/manaserv/inventoryhandler.h27
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;
};