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

#include <SlotArea.h>

Inheritance diagram for cSlotAreaFurnace:
Inheritance graph
[legend]
Collaboration diagram for cSlotAreaFurnace:
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...
 
 cSlotAreaFurnace (cFurnaceEntity *a_Furnace, cWindow &a_ParentWindow)
 
virtual void DistributeStack (cItem &a_ItemStack, cPlayer &a_Player, bool a_ShouldApply, bool a_KeepEmptySlots, bool a_BackFill) override
 Called to store as much of a_ItemStack in the area as possible. More...
 
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...
 
virtual ~cSlotAreaFurnace () override
 
- 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 ()
 
- Public Member Functions inherited from cItemGrid::cListener
virtual ~cListener ()
 

Protected Member Functions

void HandleSmeltItem (const cItem &a_Result, cPlayer &a_Player)
 Called after an item has been smelted to handle statistics etc. More...
 
virtual void OnSlotChanged (cItemGrid *a_ItemGrid, int a_SlotNum) override
 Called whenever a slot changes. More...
 

Protected Attributes

cFurnaceEntitym_Furnace
 
- Protected Attributes inherited from cSlotArea
int m_NumSlots
 
cWindowm_ParentWindow
 

Private Types

using Super = cSlotArea
 

Detailed Description

Definition at line 472 of file SlotArea.h.

Member Typedef Documentation

◆ Super

Definition at line 476 of file SlotArea.h.

Constructor & Destructor Documentation

◆ cSlotAreaFurnace()

cSlotAreaFurnace::cSlotAreaFurnace ( cFurnaceEntity a_Furnace,
cWindow a_ParentWindow 
)

Definition at line 1865 of file SlotArea.cpp.

◆ ~cSlotAreaFurnace()

cSlotAreaFurnace::~cSlotAreaFurnace ( )
overridevirtual

Definition at line 1876 of file SlotArea.cpp.

Member Function Documentation

◆ Clicked()

void cSlotAreaFurnace::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 cSlotArea.

Definition at line 1885 of file SlotArea.cpp.

◆ DistributeStack()

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

Called to store as much of a_ItemStack in the area as possible.

a_ItemStack is modified to reflect the change. The default implementation searches each slot for available space and distributes the stack there. if a_ShouldApply is true, the changes are written into the slots; if a_ShouldApply is false, only a_ItemStack is modified to reflect the number of fits (for fit-testing purposes) If a_KeepEmptySlots is true, empty slots will be skipped and won't be filled

Reimplemented from cSlotArea.

Definition at line 2022 of file SlotArea.cpp.

◆ GetSlot()

const cItem * cSlotAreaFurnace::GetSlot ( int  a_SlotNum,
cPlayer a_Player 
) const
overridevirtual

Called to retrieve an item in the specified slot for the specified player.

Must return a valid cItem.

Implements cSlotArea.

Definition at line 2072 of file SlotArea.cpp.

◆ HandleSmeltItem()

void cSlotAreaFurnace::HandleSmeltItem ( const cItem a_Result,
cPlayer a_Player 
)
protected

Called after an item has been smelted to handle statistics etc.

TODO 2014-05-12 xdot: Figure out when to call this method.

Definition at line 2105 of file SlotArea.cpp.

◆ OnSlotChanged()

void cSlotAreaFurnace::OnSlotChanged ( cItemGrid a_ItemGrid,
int  a_SlotNum 
)
overrideprotectedvirtual

Called whenever a slot changes.

Implements cItemGrid::cListener.

Definition at line 2092 of file SlotArea.cpp.

◆ SetSlot()

void cSlotAreaFurnace::SetSlot ( int  a_SlotNum,
cPlayer a_Player,
const cItem a_Item 
)
overridevirtual

Called to set an item in the specified slot for the specified player.

Implements cSlotArea.

Definition at line 2083 of file SlotArea.cpp.

Member Data Documentation

◆ m_Furnace

cFurnaceEntity* cSlotAreaFurnace::m_Furnace
protected

Definition at line 490 of file SlotArea.h.


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