summaryrefslogtreecommitdiffstats
path: root/source/cWindowOwner.h
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-08-06 22:10:16 +0200
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-08-06 22:10:16 +0200
commite8366993ce3f1cc0c2c6cde1d133773d1f23c474 (patch)
tree789fd452065ff6aa68f2ceac5664959bdb24afc0 /source/cWindowOwner.h
parentAdded the Doxygen configuration file (diff)
downloadcuberite-e8366993ce3f1cc0c2c6cde1d133773d1f23c474.tar
cuberite-e8366993ce3f1cc0c2c6cde1d133773d1f23c474.tar.gz
cuberite-e8366993ce3f1cc0c2c6cde1d133773d1f23c474.tar.bz2
cuberite-e8366993ce3f1cc0c2c6cde1d133773d1f23c474.tar.lz
cuberite-e8366993ce3f1cc0c2c6cde1d133773d1f23c474.tar.xz
cuberite-e8366993ce3f1cc0c2c6cde1d133773d1f23c474.tar.zst
cuberite-e8366993ce3f1cc0c2c6cde1d133773d1f23c474.zip
Diffstat (limited to '')
-rw-r--r--source/cWindowOwner.h24
1 files changed, 19 insertions, 5 deletions
diff --git a/source/cWindowOwner.h b/source/cWindowOwner.h
index 3a1797f74..ef08bbe44 100644
--- a/source/cWindowOwner.h
+++ b/source/cWindowOwner.h
@@ -1,13 +1,21 @@
+
#pragma once
+#include "cBlockEntity.h"
+
+
+
+
class cWindow;
-class cBlockEntity;
+/**
+Implements the base behavior expected from a class that can handle UI windows for block entities.
+*/
class cWindowOwner
{
public:
@@ -17,11 +25,17 @@ public:
cWindow* GetWindow() { return m_Window; }
- void SetEntity(cBlockEntity *a_Entity) { m_Entity = a_Entity; }
- cBlockEntity *GetEntity() { return m_Entity; }
+ void SetEntity(cBlockEntity * a_Entity) { m_Entity = a_Entity; }
+ void GetBlockPos(int & a_BlockX, int & a_BlockY, int & a_BlockZ)
+ {
+ a_BlockX = m_Entity->GetPosX();
+ a_BlockY = m_Entity->GetPosY();
+ a_BlockZ = m_Entity->GetPosZ();
+ }
+
private:
- cWindow* m_Window;
- cBlockEntity *m_Entity;
+ cWindow * m_Window;
+ cBlockEntity * m_Entity;
};