summaryrefslogtreecommitdiffstats
path: root/src/Inventory.h
diff options
context:
space:
mode:
authorPablo Beltrán <spekdrum@gmail.com>2017-05-24 08:09:58 +0200
committerMattes D <github@xoft.cz>2017-05-24 08:09:58 +0200
commit84bdba345d9b34a59337009d0880aa74d3b2d689 (patch)
treeb9b4e5580591c94d23e0ac0de6ce9e980101c6ef /src/Inventory.h
parentStore cChunk::m_BlockEntities in a map (#3717) (diff)
downloadcuberite-84bdba345d9b34a59337009d0880aa74d3b2d689.tar
cuberite-84bdba345d9b34a59337009d0880aa74d3b2d689.tar.gz
cuberite-84bdba345d9b34a59337009d0880aa74d3b2d689.tar.bz2
cuberite-84bdba345d9b34a59337009d0880aa74d3b2d689.tar.lz
cuberite-84bdba345d9b34a59337009d0880aa74d3b2d689.tar.xz
cuberite-84bdba345d9b34a59337009d0880aa74d3b2d689.tar.zst
cuberite-84bdba345d9b34a59337009d0880aa74d3b2d689.zip
Diffstat (limited to 'src/Inventory.h')
-rw-r--r--src/Inventory.h21
1 files changed, 19 insertions, 2 deletions
diff --git a/src/Inventory.h b/src/Inventory.h
index ec159ec8e..2507cceed 100644
--- a/src/Inventory.h
+++ b/src/Inventory.h
@@ -43,11 +43,13 @@ public:
invArmorCount = 4,
invInventoryCount = 9 * 3,
invHotbarCount = 9,
+ invShieldCount = 1, // Number of slots in shield slots grid
invArmorOffset = 0,
invInventoryOffset = invArmorOffset + invArmorCount,
invHotbarOffset = invInventoryOffset + invInventoryCount,
- invNumSlots = invHotbarOffset + invHotbarCount
+ invShieldOffset = invHotbarOffset + invHotbarCount, // Offset where shield slots start
+ invNumSlots = invShieldOffset + invShieldCount
} ;
// tolua_end
@@ -120,17 +122,31 @@ public:
// tolua_begin
+ /** Returns current item in a_SlotNum slot */
const cItem & GetSlot(int a_SlotNum) const;
+ /** Returns current item in a_ArmorSlotNum in armor slots */
const cItem & GetArmorSlot(int a_ArmorSlotNum) const;
+ /** Returns current item in a_ArmorSlotNum in inventory slots */
const cItem & GetInventorySlot(int a_InventorySlotNum) const;
+ /** Returns current item in a_ArmorSlotNum in hotbar slots */
const cItem & GetHotbarSlot(int a_HotBarSlotNum) const;
+ /** Returns current item in shield slot */
+ const cItem & GetShieldSlot() const;
+ /** Returns current equiped item */
const cItem & GetEquippedItem(void) const;
+ /** Puts a_Item item in a_SlotNum slot number */
void SetSlot(int a_SlotNum, const cItem & a_Item);
+ /** Puts a_Item item in a_ArmorSlotNum slot number in armor slots */
void SetArmorSlot(int a_ArmorSlotNum, const cItem & a_Item);
+ /** Puts a_Item item in a_InventorySlotNum slot number in inventory slots */
void SetInventorySlot(int a_InventorySlotNum, const cItem & a_Item);
+ /** Puts a_Item item in a_HotBarSlotNum slot number in hotbar slots */
void SetHotbarSlot(int a_HotBarSlotNum, const cItem & a_Item);
-
+ /** Sets current item in shield slot */
+ void SetShieldSlot(const cItem & a_Item);
+ /** Sets equiped item to the a_SlotNum slot number */
void SetEquippedSlotNum(int a_SlotNum);
+ /** Returns slot number of equiped item */
int GetEquippedSlotNum(void) { return m_EquippedSlotNum; }
/** Adds (or subtracts, if a_AddToCount is negative) to the count of items in the specified slot.
@@ -170,6 +186,7 @@ protected:
cItemGrid m_ArmorSlots;
cItemGrid m_InventorySlots;
cItemGrid m_HotbarSlots;
+ cItemGrid m_ShieldSlots;
int m_EquippedSlotNum;