summaryrefslogtreecommitdiffstats
path: root/source/UI/cWindowOwner.h
diff options
context:
space:
mode:
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