Cuberite
A lightweight, fast and extensible game server for Minecraft
EnchantingWindow.h
Go to the documentation of this file.
1 
2 // EnchantingWindow.h
3 
4 // Representing the UI window for the enchanting block
5 
6 
7 
8 
9 
10 #pragma once
11 
12 #include "Window.h"
13 
14 
15 
16 
17 
19 
20 
21 
22 
23 
24 class cEnchantingWindow final :
25  public cWindow
26 {
27  using Super = cWindow;
28 
29 public:
30 
31  cEnchantingWindow(Vector3i a_BlockPos, const AString & a_Title);
32 
35  virtual void SetProperty(size_t a_Property, short a_Value) override;
36 
38  short GetProperty(size_t a_Property);
39 
40  virtual void DistributeStack(cItem & a_ItemStack, int a_Slot, cPlayer & a_Player, cSlotArea * a_ClickedArea, bool a_ShouldApply) override;
41 
43 
44 protected:
45 
46  std::array<short, 3> m_PropertyValue;
48 };
std::string AString
Definition: StringUtils.h:11
Definition: Player.h:29
Definition: Item.h:37
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 void SetProperty(size_t a_Property, short a_Value) override
Sends enchantment properties to the client.
std::array< short, 3 > m_PropertyValue
cEnchantingWindow(Vector3i a_BlockPos, const AString &a_Title)
short GetProperty(size_t a_Property)
Return the level requirement of the given enchantment slot.
cSlotAreaEnchanting * m_SlotArea
Represents a UI window.
Definition: Window.h:54
cWindow(WindowType a_WindowType, const AString &a_WindowTitle)
Definition: Window.cpp:30