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/cWindow.h | 43 +++++++++++++++++++++++++++++-------------- 1 file changed, 29 insertions(+), 14 deletions(-) (limited to 'source/cWindow.h') 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 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; } -- cgit v1.2.3