diff options
author | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-09-20 15:25:54 +0200 |
---|---|---|
committer | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-09-20 15:25:54 +0200 |
commit | bc466f07a454271d4845a7e8c7f0822541c5afbd (patch) | |
tree | c8455a2af322bbd847b6b4ea74256b78aa834c4c /source/cInventory.h | |
parent | ProtoProxy: moar packets! (can now sustain parsing while connected to vanilla server, most of the times) (diff) | |
download | cuberite-bc466f07a454271d4845a7e8c7f0822541c5afbd.tar cuberite-bc466f07a454271d4845a7e8c7f0822541c5afbd.tar.gz cuberite-bc466f07a454271d4845a7e8c7f0822541c5afbd.tar.bz2 cuberite-bc466f07a454271d4845a7e8c7f0822541c5afbd.tar.lz cuberite-bc466f07a454271d4845a7e8c7f0822541c5afbd.tar.xz cuberite-bc466f07a454271d4845a7e8c7f0822541c5afbd.tar.zst cuberite-bc466f07a454271d4845a7e8c7f0822541c5afbd.zip |
Diffstat (limited to 'source/cInventory.h')
-rw-r--r-- | source/cInventory.h | 40 |
1 files changed, 17 insertions, 23 deletions
diff --git a/source/cInventory.h b/source/cInventory.h index 96d744baf..bce485852 100644 --- a/source/cInventory.h +++ b/source/cInventory.h @@ -1,7 +1,7 @@ #pragma once -#include "cWindowOwner.h" +#include "cItem.h" @@ -12,7 +12,6 @@ namespace Json class Value; }; -class cItem; class cClientHandle; class cPlayer; @@ -21,10 +20,9 @@ class cPlayer; class cInventory //tolua_export - : public cWindowOwner { //tolua_export public: - cInventory(cPlayer* a_Owner); + cInventory(cPlayer & a_Owner); ~cInventory(); void Clear(); //tolua_export @@ -38,19 +36,17 @@ public: void SaveToJson(Json::Value & a_Value); bool LoadFromJson(Json::Value & a_Value); - void SendWholeInventory( cClientHandle* a_Client ); - void SendWholeInventoryToAll(void); + void SendWholeInventory(cClientHandle & a_Client); - cItem* GetSlot( int a_SlotNum ); //tolua_export - cItem* GetSlots() const { return m_Slots; } - cItem* GetFromHotBar( int a_SlotNum ); //tolua_export + cItem * GetSlot(int a_SlotNum ); //tolua_export + cItem * GetSlots(void) { return m_Slots; } + const cItem * GetSlots(void) const { return m_Slots; } + cItem * GetFromHotBar(int a_HotBarSlotNum); //tolua_export cItem & GetEquippedItem(void); //tolua_export const cItem & GetEquippedItem(void) const; - void SetEquippedSlot( int a_SlotNum ); //tolua_export - short GetEquippedSlot() { return m_EquippedSlot; } //tolua_export - - virtual void Clicked(short a_SlotNum, bool a_IsRightClick, bool a_IsShiftPressed, const cItem & a_HeldItem) = 0; + void SetEquippedSlot(int a_SlotNum); //tolua_export + short GetEquippedSlot(void) { return m_EquippedSlot; } //tolua_export void SendSlot( int a_SlotNum ); //tolua_export @@ -74,19 +70,17 @@ public: protected: bool AddToBar( cItem & a_Item, const int a_Offset, const int a_Size, bool* a_bChangedSlots, int a_Mode = 0 ); - cItem* m_Slots; - cItem* m_MainSlots; - cItem* m_CraftSlots; - cItem* m_ArmorSlots; - cItem* m_HotSlots; + cItem m_Slots[c_NumSlots]; + + cItem * m_MainSlots; + cItem * m_CraftSlots; + cItem * m_ArmorSlots; + cItem * m_HotSlots; - cItem* m_EquippedItem; + cItem * m_EquippedItem; short m_EquippedSlot; - cPlayer* m_Owner; - - // cWindowOwner override: - virtual void GetBlockPos(int & a_BlockX, int & a_BlockY, int & a_BlockZ) override {} // UNUSED for an inventory + cPlayer & m_Owner; }; //tolua_export |