Cuberite
A lightweight, fast and extensible game server for Minecraft
ChestWindow.h
Go to the documentation of this file.
1 
2 // ChestWindow.h
3 
4 // Representing the UI window for the chest block
5 
6 
7 
8 
9 
10 #pragma once
11 
12 #include "Window.h"
13 
14 
15 
16 
17 
19  public cWindow
20 {
21  using Super = cWindow;
22 
23 public:
24 
25  cChestWindow(cChestEntity * a_Chest);
26 
27  cChestWindow(cChestEntity * a_PrimaryChest, cChestEntity * a_SecondaryChest);
28 
29  virtual ~cChestWindow() override;
30 
31  virtual bool ClosedByPlayer(cPlayer & a_Player, bool a_CanRefuse) override;
32 
33  virtual void OpenedByPlayer(cPlayer & a_Player) override;
34 
35  virtual void DistributeStack(cItem & a_ItemStack, int a_Slot, cPlayer & a_Player, cSlotArea * a_ClickedArea, bool a_ShouldApply) override;
36 
37 protected:
39  Vector3i m_BlockPos; // Position of the chest, for the window-close packet
42 };
43 
44 
45 
46 
Definition: Player.h:29
Definition: Item.h:37
virtual void OpenedByPlayer(cPlayer &a_Player) override
Definition: ChestWindow.cpp:91
virtual bool ClosedByPlayer(cPlayer &a_Player, bool a_CanRefuse) override
Called when a player closes this window; notifies all slot areas.
Definition: ChestWindow.cpp:72
cWorld * m_World
Definition: ChestWindow.h:38
Vector3i m_BlockPos
Definition: ChestWindow.h:39
cChestWindow(cChestEntity *a_Chest)
Definition: ChestWindow.cpp:16
cChestEntity * m_PrimaryChest
Definition: ChestWindow.h:40
cChestEntity * m_SecondaryChest
Definition: ChestWindow.h:41
virtual void DistributeStack(cItem &a_ItemStack, int a_Slot, cPlayer &a_Player, cSlotArea *a_ClickedArea, bool a_ShouldApply) override
Called on shift-clicking to distribute the stack into other areas; Modifies a_ItemStack as it is dist...
virtual ~cChestWindow() override
Definition: ChestWindow.cpp:60
Represents a UI window.
Definition: Window.h:54
cWindow(WindowType a_WindowType, const AString &a_WindowTitle)
Definition: Window.cpp:30
Definition: World.h:53