Class endstone::PlayerInventory¶
ClassList > endstone > PlayerInventory
Interface to the inventory of a Player , including the four armor slots and any extra slots.
#include <endstone/inventory/player_inventory.h>
Inherits the following classes: endstone::Inventory
Public Functions inherited from endstone::Inventory¶
Type | Name |
---|---|
virtual void | addItem (ItemStack & item) = 0 Stores the given ItemStacks in the inventory. This will try to fill existing stacks and empty slots as well as it can. |
virtual void | clear () = 0 Clears out the whole Inventory . |
virtual int | first (ItemStack & item) = 0 Returns the first slot in the inventory containing an ItemStack with the given stack. |
virtual std::vector< std::shared_ptr< ItemStack > > | getContents () const = 0 Returns all ItemStacks from the inventory. |
virtual std::shared_ptr< ItemStack > | getItem (int index) const = 0 Returns the ItemStack found in the slot at the given index. |
virtual int | getMaxStackSize () const = 0 Returns the maximum stack size for an ItemStack in this inventory. |
virtual int | getSize () const = 0 Returns the size of the inventory. |
virtual bool | isEmpty () const = 0 Check whether this inventory is empty. An inventory is considered to be empty if there are no ItemStacks in any slot of this inventory. |
virtual void | setItem (int index, std::shared_ptr< ItemStack > item) = 0 Stores the ItemStack at the given index of the inventory. |
virtual | ~Inventory () = default |
The documentation for this class was generated from the following file include/endstone/inventory/player_inventory.h