summaryrefslogtreecommitdiffstats
path: root/source/cWindowOwner.h
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-09-20 15:25:54 +0200
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-09-20 15:25:54 +0200
commitbc466f07a454271d4845a7e8c7f0822541c5afbd (patch)
treec8455a2af322bbd847b6b4ea74256b78aa834c4c /source/cWindowOwner.h
parentProtoProxy: moar packets! (can now sustain parsing while connected to vanilla server, most of the times) (diff)
downloadcuberite-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 '')
-rw-r--r--source/UI/cWindowOwner.h (renamed from source/cWindowOwner.h)17
1 files changed, 13 insertions, 4 deletions
diff --git a/source/cWindowOwner.h b/source/UI/cWindowOwner.h
index 6c9a15a45..1ce03ed30 100644
--- a/source/cWindowOwner.h
+++ b/source/UI/cWindowOwner.h
@@ -1,21 +1,29 @@
#pragma once
-#include "cBlockEntity.h"
-#include "cEntity.h"
+#include "../cBlockEntity.h"
+#include "../cEntity.h"
+#include "cWindow.h"
+
+/*
+Being a descendant of cWindowOwner means that the class can own one window. That window can be
+queried, opened by other players, closed by players and finally destroyed.
+Also, a cWindowOwner can be queried for the block coords where the window is displayed. That will be used
+for entities / players in motion to close their windows when they get too far away from the window "source".
+*/
-class cWindow;
+// class cWindow;
/**
-Base class for the behavior expected from a class that can handle UI windows for block entities.
+Base class for the window owning
*/
class cWindowOwner
{
@@ -33,6 +41,7 @@ public:
void OpenWindow(cWindow * a_Window)
{
m_Window = a_Window;
+ m_Window->SetOwner(this);
}
cWindow * GetWindow(void) const