summaryrefslogtreecommitdiffstats
path: root/source/cWindow.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/cWindow.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 'source/cWindow.h')
-rw-r--r--source/cWindow.h43
1 files changed, 29 insertions, 14 deletions
diff --git a/source/cWindow.h b/source/cWindow.h
index 7d31d71e3..9d62dc43a 100644
--- a/source/cWindow.h
+++ b/source/cWindow.h
@@ -1,3 +1,12 @@
+
+// cWindow.h
+
+// Interfaces to the cWindow class representing a UI window for a specific block
+
+
+
+
+
#pragma once
@@ -14,26 +23,32 @@ typedef std::list<cPlayer *> cPlayerList;
+/**
+Represents a UI window (base class) for a specific block entity.
+
+There is up to one instance of the class for each block entity
+Each window has a list of players that are currently using it
+When there's no player using a window, it is destroyed
+*/
class cWindow
{
public:
- cWindow( cWindowOwner* a_Owner, bool a_bInventoryVisible );
+ enum WindowType
+ {
+ Inventory = -1, // This value is never actually sent to a client
+ Chest = 0,
+ Workbench = 1,
+ Furnace = 2,
+ Dispenser = 3,
+ Enchantment = 4,
+ Brewery = 5
+ };
+
+ cWindow(cWindowOwner * a_Owner, bool a_bInventoryVisible, WindowType a_WindowType, int a_WindowID);
~cWindow();
int GetWindowID() { return m_WindowID; }
- void SetWindowID( int a_WindowID ) { m_WindowID = a_WindowID; }
-
- enum WindowType {
- Chest,
- Workbench,
- Furnace,
- Dispenser,
- Enchantment,
- Brewery
- };
-
- int GetWindowType() { return m_WindowType; }
- void SetWindowType( int a_WindowType ) { m_WindowType = a_WindowType; }
+ int GetWindowType(void) const { return m_WindowType; }
cItem* GetSlots() { return m_Slots; }
int GetNumSlots() { return m_NumSlots; }