11 #include "../Inventory.h" 178 virtual void DistributeStack(
cItem & a_ItemStack,
cPlayer & a_Player,
bool a_ShouldApply,
bool a_KeepEmptySlots,
bool a_BackFill)
override;
183 static bool CanPlaceArmorInSlot(
int a_SlotNum,
const cItem & a_Item);
209 virtual void OnSlotChanged(
cItemGrid * a_ItemGrid,
int a_SlotNum)
override;
234 void TossItems(
cPlayer & a_Player,
int a_Begin,
int a_End);
237 typedef std::map<UInt32, std::vector<cItem> >
cItemMap;
265 virtual void DistributeStack(
cItem & a_ItemStack,
cPlayer & a_Player,
bool a_ShouldApply,
bool a_KeepEmptySlots,
bool a_BackFill)
override;
271 typedef std::list<std::pair<UInt32, cCraftingRecipe> >
cRecipeMap;
278 void ClickedResult(
cPlayer & a_Player);
282 void ShiftClickedResult(
cPlayer & a_Player);
285 void DropClickedResult(
cPlayer & a_Player);
288 void UpdateRecipe(
cPlayer & a_Player);
294 void HandleCraftItem(
const cItem & a_Result,
cPlayer & a_Player);
312 virtual void DistributeStack(
cItem & a_ItemStack,
cPlayer & a_Player,
bool a_ShouldApply,
bool a_KeepEmptySlots,
bool a_BackFill)
override;
318 bool CanTakeResultItem(
cPlayer & a_Player);
321 void OnTakeResult(
cPlayer & a_Player);
324 void UpdateResult(
cPlayer & a_Player);
348 static bool IsPlaceableItem(
short a_ItemType);
351 virtual void DistributeStack(
cItem & a_ItemStack,
cPlayer & a_Player,
bool a_ShouldApply,
bool a_KeepEmptySlots,
bool a_BackFill)
override;
359 virtual void OnSlotChanged(
cItemGrid * a_ItemGrid,
int a_SlotNum)
override;
376 virtual void DistributeStack(
cItem & a_ItemStack,
cPlayer & a_Player,
bool a_ShouldApply,
bool a_KeepEmptySlots,
bool a_BackFill)
override;
384 int GetBookshelvesCount(
cWorld & a_World);
388 void UpdateResult(
cPlayer & a_Player);
461 virtual void DistributeStack(
cItem & a_ItemStack,
cPlayer & a_Player,
bool a_ShouldApply,
bool a_KeepEmptySlots,
bool a_BackFill)
override;
469 virtual void OnSlotChanged(
cItemGrid * a_ItemGrid,
int a_SlotNum)
override;
472 void HandleSmeltItem(
const cItem & a_Result,
cPlayer & a_Player);
491 virtual void DistributeStack(
cItem & a_ItemStack,
cPlayer & a_Player,
bool a_ShouldApply,
bool a_KeepEmptySlots,
bool a_BackFill)
override;
498 virtual void OnSlotChanged(
cItemGrid * a_ItemGrid,
int a_SlotNum)
override;
501 void HandleBrewedItem(
cPlayer & a_Player,
const cItem & a_ClickedItem);
540 virtual void DistributeStack(
cItem & a_ItemStack,
cPlayer & a_Player,
bool a_ShouldApply,
bool a_KeepEmptySlots,
bool a_BackFill)
override;
cSlotAreaInventoryBase super
virtual void MiddleClicked(cPlayer &a_Player, int a_SlotNum)
Called from Clicked when the action is a middleclick.
Handles the main inventory of each player, excluding the armor and hotbar.
Slot area holding horse saddle and armor.
virtual void Clicked(cPlayer &a_Player, int a_SlotNum, eClickAction a_ClickAction, const cItem &a_ClickedItem)
Called when a player clicks in the window.
cSlotAreaArmor(cWindow &a_ParentWindow)
cChestEntity * m_TopChest
cChestEntity * m_BottomChest
cSlotAreaInventoryBase super
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)
cSlotAreaInventory(cWindow &a_ParentWindow)
char m_StackSizeToBeUsedInRepair
The stack size of the second item where was used for repair.
virtual void OnPlayerAdded(cPlayer &a_Player)
Called when a new player opens the same parent window.
Handles the armor area of the player's inventory.
cEnderChestEntity * m_EnderChest
This class is used as a callback for when a slot changes.
virtual void NumberClicked(cPlayer &a_Player, int a_SlotNum, eClickAction a_ClickAction)
Called from Clicked when the action is a number click.
virtual void DblClicked(cPlayer &a_Player, int a_SlotNum)
Called from Clicked when the action is a caDblClick.
eClickAction
Individual actions sent in the WindowClick packet.
virtual void DropClicked(cPlayer &a_Player, int a_SlotNum, bool a_DropStack)
Called from Clicked when the action is a drop click.
Handles any slot area that is representing a cItemGrid; same items for all the players.
cSlotArea(int a_NumSlots, cWindow &a_ParentWindow)
std::list< std::pair< UInt32, cCraftingRecipe > > cRecipeMap
Maps player's EntityID -> current recipe.
virtual void DistributeStack(cItem &a_ItemStack, cPlayer &a_Player, bool a_ShouldApply, bool a_KeepEmptySlots, bool a_BackFill)
Called to store as much of a_ItemStack in the area as possible.
cBrewingstandEntity * m_Brewingstand
int m_MaximumCost
The maximum cost of repairing / renaming in the anvil.
int GetNumSlots(void) const
cMinecartWithChest * m_Chest
A cSlotArea with items layout that is private to each player and is temporary, such as a crafting gri...
virtual void OnPlayerRemoved(cPlayer &a_Player)
Called when one of the players closes the parent window.
cSlotAreaShield(cWindow &a_ParentWindow)
std::map< UInt32, std::vector< cItem > > cItemMap
cSlotAreaInventoryBase super
virtual const cItem * GetSlot(int a_SlotNum, cPlayer &a_Player) const =0
Called to retrieve an item in the specified slot for the specified player.
cSlotAreaHotBar(cWindow &a_ParentWindow)
Handles any part of the inventory, using parameters in constructor to distinguish between the parts...
Handles the hotbar of each player.
virtual void SetSlot(int a_SlotNum, cPlayer &a_Player, const cItem &a_Item)=0
Called to set an item in the specified slot for the specified player.
cFurnaceEntity * m_Furnace
This class represents the player's inventory The slots are divided into three areas: ...
Handles the shield of each player.
virtual bool CollectItemsToHand(cItem &a_Dragging, cPlayer &a_Player, bool a_CollectFullStacks)
Called on DblClicking to collect all stackable items into hand.