Cuberite
A lightweight, fast and extensible game server for Minecraft
Public Member Functions | Static Public Member Functions | Private Types | List of all members
cSlotAreaArmor Class Reference

Handles the armor area of the player's inventory. More...

#include <SlotArea.h>

Inheritance diagram for cSlotAreaArmor:
Inheritance graph
[legend]
Collaboration diagram for cSlotAreaArmor:
Collaboration graph
[legend]

Public Member Functions

virtual void Clicked (cPlayer &a_Player, int a_SlotNum, eClickAction a_ClickAction, const cItem &a_ClickedItem) override
 Called when a player clicks in the window. More...
 
 cSlotAreaArmor (cWindow &a_ParentWindow)
 
virtual void DistributeStack (cItem &a_ItemStack, cPlayer &a_Player, bool a_ShouldApply, bool a_KeepEmptySlots, bool a_BackFill) override
 Distributing the stack is allowed only for compatible items (helmets into helmet slot etc.) More...
 
- Public Member Functions inherited from cSlotAreaInventoryBase
 cSlotAreaInventoryBase (int a_NumSlots, int a_SlotOffset, cWindow &a_ParentWindow)
 
virtual const cItemGetSlot (int a_SlotNum, cPlayer &a_Player) const override
 Called to retrieve an item in the specified slot for the specified player. More...
 
virtual void SetSlot (int a_SlotNum, cPlayer &a_Player, const cItem &a_Item) override
 Called to set an item in the specified slot for the specified player. More...
 
- Public Member Functions inherited from cSlotArea
virtual bool CollectItemsToHand (cItem &a_Dragging, cPlayer &a_Player, bool a_CollectFullStacks)
 Called on DblClicking to collect all stackable items into hand. More...
 
 cSlotArea (int a_NumSlots, cWindow &a_ParentWindow)
 
virtual void DblClicked (cPlayer &a_Player, int a_SlotNum)
 Called from Clicked when the action is a caDblClick. More...
 
virtual void DropClicked (cPlayer &a_Player, int a_SlotNum, bool a_DropStack)
 Called from Clicked when the action is a drop click. More...
 
int GetNumSlots (void) const
 
virtual void MiddleClicked (cPlayer &a_Player, int a_SlotNum)
 Called from Clicked when the action is a middleclick. More...
 
virtual void NumberClicked (cPlayer &a_Player, int a_SlotNum, eClickAction a_ClickAction)
 Called from Clicked when the action is a number click. More...
 
virtual void OnPlayerAdded (cPlayer &a_Player)
 Called when a new player opens the same parent window. More...
 
virtual void OnPlayerRemoved (cPlayer &a_Player)
 Called when one of the players closes the parent window. More...
 
virtual void ShiftClicked (cPlayer &a_Player, int a_SlotNum, const cItem &a_ClickedItem)
 Called from Clicked when the action is a shiftclick (left or right) More...
 
virtual ~cSlotArea ()
 

Static Public Member Functions

static bool CanPlaceArmorInSlot (int a_SlotNum, const cItem &a_Item)
 

Private Types

using Super = cSlotAreaInventoryBase
 

Additional Inherited Members

- Protected Attributes inherited from cSlotAreaInventoryBase
int m_SlotOffset
 
- Protected Attributes inherited from cSlotArea
int m_NumSlots
 
cWindowm_ParentWindow
 

Detailed Description

Handles the armor area of the player's inventory.

Definition at line 171 of file SlotArea.h.

Member Typedef Documentation

◆ Super

Definition at line 174 of file SlotArea.h.

Constructor & Destructor Documentation

◆ cSlotAreaArmor()

cSlotAreaArmor::cSlotAreaArmor ( cWindow a_ParentWindow)
inline

Definition at line 178 of file SlotArea.h.

Member Function Documentation

◆ CanPlaceArmorInSlot()

bool cSlotAreaArmor::CanPlaceArmorInSlot ( int  a_SlotNum,
const cItem a_Item 
)
static

Definition at line 2585 of file SlotArea.cpp.

◆ Clicked()

void cSlotAreaArmor::Clicked ( cPlayer a_Player,
int  a_SlotNum,
eClickAction  a_ClickAction,
const cItem a_ClickedItem 
)
overridevirtual

Called when a player clicks in the window.

Parameters taken from the click packet.

Reimplemented from cSlotAreaInventoryBase.

Definition at line 2502 of file SlotArea.cpp.

◆ DistributeStack()

void cSlotAreaArmor::DistributeStack ( cItem a_ItemStack,
cPlayer a_Player,
bool  a_ShouldApply,
bool  a_KeepEmptySlots,
bool  a_BackFill 
)
overridevirtual

Distributing the stack is allowed only for compatible items (helmets into helmet slot etc.)

Reimplemented from cSlotArea.

Definition at line 2462 of file SlotArea.cpp.


The documentation for this class was generated from the following files: