From e8366993ce3f1cc0c2c6cde1d133773d1f23c474 Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Mon, 6 Aug 2012 20:10:16 +0000 Subject: A bit of cleanup and documentation around the UI window handling git-svn-id: http://mc-server.googlecode.com/svn/trunk@716 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/cWindowOwner.h | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) (limited to 'source/cWindowOwner.h') 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; }; -- cgit v1.2.3