Skip to content

Class endstone::ItemStack

ClassList > endstone > ItemStack

Represents a stack of items.

  • #include <endstone/inventory/item_stack.h>

Inherits the following classes: std::enable_shared_from_this< ItemStack >

Public Functions

Type Name
ItemStack () = default
ItemStack (std::string type, int amount=1)
virtual int getAmount () const
Gets the amount of items in this stack.
virtual std::string getType () const
Gets the type of this item.
virtual void setAmount (int amount)
Sets the amount of items in this stack.
virtual void setType (std::string type)
Sets the type of this item.
virtual ~ItemStack () = default

Protected Functions

Type Name
virtual const detail::EndstoneItemStack * asEndstoneItemStack () const
virtual detail::EndstoneItemStack * asEndstoneItemStack ()

Public Functions Documentation

function ItemStack [½]

endstone::ItemStack::ItemStack () = default

function ItemStack [2/2]

inline explicit endstone::ItemStack::ItemStack (
    std::string type,
    int amount=1
) 

function getAmount

Gets the amount of items in this stack.

inline virtual int endstone::ItemStack::getAmount () const

Returns:

Amount of items in this stack


function getType

Gets the type of this item.

inline virtual std::string endstone::ItemStack::getType () const

Returns:

Type of the items in this stack


function setAmount

Sets the amount of items in this stack.

inline virtual void endstone::ItemStack::setAmount (
    int amount
) 

Parameters:

  • amount New amount of items in this stack

function setType

Sets the type of this item.

inline virtual void endstone::ItemStack::setType (
    std::string type
) 

Parameters:

  • type New type to set the items in this stack to

function ~ItemStack

virtual endstone::ItemStack::~ItemStack () = default

Protected Functions Documentation

function asEndstoneItemStack [½]

inline virtual const detail::EndstoneItemStack * endstone::ItemStack::asEndstoneItemStack () const

function asEndstoneItemStack [2/2]

inline virtual detail::EndstoneItemStack * endstone::ItemStack::asEndstoneItemStack () 

Friends Documentation

friend EndstoneItemStack

class endstone::ItemStack::EndstoneItemStack (
    detail::EndstoneItemStack
) 


The documentation for this class was generated from the following file include/endstone/inventory/item_stack.h