diff options
author | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2013-04-10 23:40:30 +0200 |
---|---|---|
committer | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2013-04-10 23:40:30 +0200 |
commit | dc878898f36473c4df54457d2738562df4dec908 (patch) | |
tree | 99e4daa3c37c8abe327605d61dd0081acb577d34 /source/DispenserEntity.h | |
parent | Fixed gcc build (diff) | |
download | cuberite-dc878898f36473c4df54457d2738562df4dec908.tar cuberite-dc878898f36473c4df54457d2738562df4dec908.tar.gz cuberite-dc878898f36473c4df54457d2738562df4dec908.tar.bz2 cuberite-dc878898f36473c4df54457d2738562df4dec908.tar.lz cuberite-dc878898f36473c4df54457d2738562df4dec908.tar.xz cuberite-dc878898f36473c4df54457d2738562df4dec908.tar.zst cuberite-dc878898f36473c4df54457d2738562df4dec908.zip |
Diffstat (limited to '')
-rw-r--r-- | source/DispenserEntity.h | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/source/DispenserEntity.h b/source/DispenserEntity.h index 9d27c59c4..ad755c7db 100644 --- a/source/DispenserEntity.h +++ b/source/DispenserEntity.h @@ -3,7 +3,7 @@ #include "BlockEntity.h"
#include "UI/WindowOwner.h"
-#include "Item.h"
+#include "ItemGrid.h"
@@ -28,7 +28,7 @@ class cDispenserEntity : public:
cDispenserEntity(int a_X, int a_Y, int a_Z, cWorld * a_World);
virtual ~cDispenserEntity();
- virtual void Destroy();
+ virtual void Destroy(void);
bool LoadFromJson(const Json::Value & a_Value);
@@ -38,17 +38,21 @@ public: virtual bool Tick(float a_Dt) override;
virtual void UsedBy(cPlayer * a_Player) override;
- const cItem * GetSlot(int i) const { return &(m_Items[i]); }
+ const cItem & GetSlot(int a_SlotNum) const { return m_Contents.GetSlot(a_SlotNum); }
- void SetSlot(int a_Slot, const cItem & a_Item);
+ void SetSlot(int a_SlotNum, const cItem & a_Item) { m_Contents.SetSlot(a_SlotNum, a_Item); }
- void Activate();
+ /// Sets the dispenser to dispense an item in the next tick
+ void Activate(void);
+
+ const cItemGrid & GetContents(void) const { return m_Contents; }
+ cItemGrid & GetContents(void) { return m_Contents; }
private:
- cItem * m_Items;
- bool m_CanDispense;
+ cItemGrid m_Contents;
+ bool m_ShouldDispense; ///< If true, the dispenser will dispense an item in the next tick
- void Dispense();
+ void Dispense(void);
};
|