LeviLamina
Loading...
Searching...
No Matches
SimpleSparseContainer Class Reference
+ Inheritance diagram for SimpleSparseContainer:

Public Types

using SparseContainerData = ::std::unordered_map<int, ::ItemStack>
 
using ItemStackNetIdChangedCallback = ::std::function<void(int, ::ItemStack const&)>
 
using TransactionContext = std::function<void(::Container&, int, ::ItemStack const&, ::ItemStack const&)>
 
using Iterator = ContainerIterator<Container>
 
using ConstIterator = ContainerIterator<Container const>
 
using ReverseIterator = std::reverse_iterator<Iterator>
 
using ConstReverseIterator = std::reverse_iterator<ConstIterator>
 

Public Member Functions

SimpleSparseContaineroperator= (SimpleSparseContainer const &)
 
 SimpleSparseContainer (SimpleSparseContainer const &)
 
virtual::ItemStack const & getItem (int slot) const
 
virtual void setItem (int modelSlot, ::ItemStack const &item)
 
virtual void startOpen (::Player &player)
 
virtual void stopOpen (::Player &player)
 
virtual int getContainerSize () const
 
virtual int getMaxStackSize () const
 
virtual void containerContentChanged (int slot)
 
virtual void serverInitItemStackIds (int containerSlot, int count, ::std::function< void(int, ::ItemStack const &)> onNetIdChanged)
 
MCAPI SimpleSparseContainer (::Container &backingContainer, ::SparseContainerBackingSetType backingSetType, ::std::unique_ptr<::ISparseContainerSetListener > sparseContainerSetListener, ::std::unique_ptr<::IPlayerContainerSetter > playerSetter)
 
MCAPI void _setBackingContainerSlot (int slot, ::ItemStack const &newItem)
 
MCAPI void * $ctor (::Container &backingContainer, ::SparseContainerBackingSetType backingSetType, ::std::unique_ptr<::ISparseContainerSetListener > sparseContainerSetListener, ::std::unique_ptr<::IPlayerContainerSetter > playerSetter)
 
MCAPI::ItemStack const & $getItem (int slot) const
 
MCAPI void $setItem (int modelSlot, ::ItemStack const &item)
 
MCAPI void $startOpen (::Player &player)
 
MCAPI void $stopOpen (::Player &player)
 
MCAPI int $getContainerSize () const
 
MCAPI int $getMaxStackSize () const
 
MCAPI void $containerContentChanged (int slot)
 
MCAPI void $serverInitItemStackIds (int containerSlot, int count, ::std::function< void(int, ::ItemStack const &)> onNetIdChanged)
 
std::string const & getTypeName () const
 
LLNDAPI optional_ref< ItemStackgetItemNonConst (int index)
 
ItemStackoperator[] (int index)
 
ItemStack const & operator[] (int index) const
 
constexpr Iterator begin () noexcept
 
constexpr ConstIterator cbegin () const noexcept
 
constexpr Iterator end () noexcept
 
constexpr ConstIterator cend () const noexcept
 
constexpr ReverseIterator rbegin () noexcept
 
constexpr ConstReverseIterator crbegin () const noexcept
 
constexpr ReverseIterator rend () noexcept
 
constexpr ConstReverseIterator crend () const noexcept
 
virtual void init ()
 
virtual void addContentChangeListener (::ContainerContentChangeListener *listener)
 
virtual void removeContentChangeListener (::ContainerContentChangeListener *listener)
 
virtual ::Bedrock::PubSub::Connector< void()> * getContainerRemovedConnector ()
 
virtual bool hasRemovedSubscribers () const
 
virtual bool hasRoomForItem (::ItemStack const &item)
 
virtual bool addItem (::ItemStack &item)
 
virtual bool addItemWithForceBalance (::ItemStack &item)
 
virtual bool addItemToFirstEmptySlot (::ItemStack const &item)
 
virtual void setItemWithForceBalance (int slot, ::ItemStack const &item, bool forceBalanced)
 
virtual void removeItem (int slot, int count)
 
virtual void removeAllItems ()
 
virtual void removeAllItemsWithForceBalance ()
 
virtual void containerRemoved ()
 
virtual void dropSlotContent (::BlockSource &region, ::Vec3 const &pos, bool randomizeDrop, int slot)
 
virtual void dropContents (::BlockSource &region, ::Vec3 const &pos, bool randomizeDrop)
 
virtual ::std::vector<::ItemStackgetSlotCopies () const
 
virtual ::std::vector<::ItemStack const * > const getSlots () const
 
virtual int getEmptySlotsCount () const
 
virtual int getItemCount (::ItemStack const &compare) const
 
MCAPI int getItemCount (::std::function< bool(::ItemStack const &)> comparator)
 
virtual int firstEmptySlot () const
 
virtual int firstItem () const
 
virtual int findFirstSlotForItem (::ItemStack const &item) const
 
virtual int reverseFindFirstSlotForItem (::ItemStack const &item) const
 
virtual bool canPushInItem (int, int, ::ItemStack const &) const
 
virtual bool canPullOutItem (int, int, ::ItemStack const &) const
 
virtual void setContainerChanged (int slot)
 
virtual void setContainerMoved ()
 
virtual void setCustomName (::Bedrock::Safety::RedactableString const &name)
 
virtual bool hasCustomName () const
 
virtual void readAdditionalSaveData (::CompoundTag const &tag)
 
virtual void addAdditionalSaveData (::CompoundTag &tag)
 
virtual void createTransactionContext (::std::function< void(::Container &, int, ::ItemStack const &, ::ItemStack const &)> callback, ::std::function< void()> execute)
 
virtual void initializeContainerContents (::BlockSource &region)
 
virtual bool isEmpty () const
 
virtual bool isSlotDisabled (int) const
 
MCAPI void _dropSlotContent (::BlockSource &region, ::Random &random, ::Vec3 const &pos, bool randomizeDrop, int slot)
 
MCAPI void _serverInitId (int slot, ::ItemStack &item, ::std::function< void(int, ::ItemStack const &)> onNetIdChanged)
 
MCAPI int getRedstoneSignalFromContainer (::BlockSource &region)
 
MCAPI void removeCloseListener (::ContainerCloseListener *listener)
 
MCAPI void triggerTransactionChange (int slot, ::ItemStack const &oldItem, ::ItemStack const &newItem)
 
MCAPI void * $ctor (::Container const &)
 
MCAPI void * $ctor (::SharedTypes::Legacy::ContainerType type)
 
MCAPI void * $ctor (::SharedTypes::Legacy::ContainerType type, ::std::string const &name, bool customName)
 
MCAPI void $dtor ()
 
MCFOLD void $init ()
 
MCAPI void $addContentChangeListener (::ContainerContentChangeListener *listener)
 
MCAPI void $removeContentChangeListener (::ContainerContentChangeListener *listener)
 
MCFOLD ::Bedrock::PubSub::Connector< void()> * $getContainerRemovedConnector ()
 
MCAPI bool $hasRemovedSubscribers () const
 
MCAPI bool $hasRoomForItem (::ItemStack const &item)
 
MCAPI bool $addItem (::ItemStack &item)
 
MCAPI bool $addItemWithForceBalance (::ItemStack &item)
 
MCAPI bool $addItemToFirstEmptySlot (::ItemStack const &item)
 
MCFOLD void $setItemWithForceBalance (int slot, ::ItemStack const &item, bool forceBalanced)
 
MCAPI void $removeItem (int slot, int count)
 
MCAPI void $removeAllItems ()
 
MCAPI void $removeAllItemsWithForceBalance ()
 
MCAPI void $containerRemoved ()
 
MCAPI void $dropSlotContent (::BlockSource &region, ::Vec3 const &pos, bool randomizeDrop, int slot)
 
MCAPI void $dropContents (::BlockSource &region, ::Vec3 const &pos, bool randomizeDrop)
 
MCAPI ::std::vector<::ItemStack$getSlotCopies () const
 
MCAPI ::std::vector<::ItemStack const * > const $getSlots () const
 
MCFOLD int $getEmptySlotsCount () const
 
MCAPI int $getItemCount (::ItemStack const &compare) const
 
MCAPI int $firstEmptySlot () const
 
MCAPI int $firstItem () const
 
MCAPI int $findFirstSlotForItem (::ItemStack const &item) const
 
MCAPI int $reverseFindFirstSlotForItem (::ItemStack const &item) const
 
MCFOLD bool $canPushInItem (int, int, ::ItemStack const &) const
 
MCFOLD bool $canPullOutItem (int, int, ::ItemStack const &) const
 
MCAPI void $setContainerChanged (int slot)
 
MCAPI void $setContainerMoved ()
 
MCAPI void $setCustomName (::Bedrock::Safety::RedactableString const &name)
 
MCAPI bool $hasCustomName () const
 
MCAPI void $readAdditionalSaveData (::CompoundTag const &tag)
 
MCAPI void $addAdditionalSaveData (::CompoundTag &tag)
 
MCAPI void $createTransactionContext (::std::function< void(::Container &, int, ::ItemStack const &, ::ItemStack const &)> callback, ::std::function< void()> execute)
 
MCFOLD void $initializeContainerContents (::BlockSource &region)
 
MCAPI bool $isEmpty () const
 
MCFOLD bool $isSlotDisabled (int) const
 
MCAPI void $dtor ()
 

Static Public Member Functions

static MCAPI void ** $vftableForContainerContentChangeListener ()
 
static MCAPI void ** $vftableForContainer ()
 
static MCAPI ::SharedTypes::Legacy::ContainerType getContainerTypeId (::std::string const &name)
 
static MCAPI ::BidirectionalUnorderedMap<::SharedTypes::Legacy::ContainerType, ::std::string > const & containerTypeMap ()
 
static MCAPI void ** $vftable ()
 
static MCAPI void ** $vftable ()
 

Public Attributes

::ll::TypedStorage< 8, 8, ::Container & > mBackingContainer
 
::ll::TypedStorage< 4, 4, ::SparseContainerBackingSetType const > mBackingSetType
 
::ll::TypedStorage< 8, 64, ::std::unordered_map< int, ::ItemStack > > mItems
 
::ll::TypedStorage< 8, 8, ::std::unique_ptr<::ISparseContainerSetListener > > mSparseContainerSetListener
 
::ll::TypedStorage< 8, 8, ::std::unique_ptr<::IPlayerContainerSetter > > mPlayerSetter
 
::SharedTypes::Legacy::ContainerType mContainerType
 
::SharedTypes::Legacy::ContainerType mGameplayContainerType
 
::std::unordered_set<::ContainerContentChangeListener * > mContentChangeListeners
 
::std::unordered_set<::ContainerSizeChangeListener * > mSizeChangeListeners
 
::std::unordered_set<::ContainerCloseListener * > mCloseListeners
 
::Container::PublisherWrapper mRemovedPublisher
 
::std::deque< TransactionContextmTransactionContextStack
 
::Bedrock::Safety::RedactableString mName
 
bool mCustomName
 
::ContainerOwner mContainerOwner
 
::ContainerRuntimeId mContainerRuntimeId
 

Constructor & Destructor Documentation

◆ SimpleSparseContainer()

MCAPI SimpleSparseContainer::SimpleSparseContainer ( ::Container & backingContainer,
::SparseContainerBackingSetType backingSetType,
::std::unique_ptr<::ISparseContainerSetListener > sparseContainerSetListener,
::std::unique_ptr<::IPlayerContainerSetter > playerSetter )
Attention
This function is not yet publicly available. To request access: reference this function in your code and attempt to link. The linker will report the exact symbol name. Submit a access request at https://github.com/LiteLDev/mcapi-requests/issues/new including the full symbol name.

Member Function Documentation

◆ getItem()

virtual::ItemStack const & SimpleSparseContainer::getItem ( int slot) const
virtual

Implements Container.

◆ setItem()

virtual void SimpleSparseContainer::setItem ( int modelSlot,
::ItemStack const & item )
virtual

Implements Container.

◆ startOpen()

virtual void SimpleSparseContainer::startOpen ( ::Player & player)
virtual

Implements Container.

◆ stopOpen()

virtual void SimpleSparseContainer::stopOpen ( ::Player & player)
virtual

Reimplemented from Container.

◆ getContainerSize()

virtual int SimpleSparseContainer::getContainerSize ( ) const
virtual

Implements Container.

◆ getMaxStackSize()

virtual int SimpleSparseContainer::getMaxStackSize ( ) const
virtual

Implements Container.

◆ containerContentChanged()

virtual void SimpleSparseContainer::containerContentChanged ( int slot)
virtual

◆ serverInitItemStackIds()

virtual void SimpleSparseContainer::serverInitItemStackIds ( int containerSlot,
int count,
::std::function< void(int, ::ItemStack const &)> onNetIdChanged )
virtual

Implements Container.

◆ _setBackingContainerSlot()

MCAPI void SimpleSparseContainer::_setBackingContainerSlot ( int slot,
::ItemStack const & newItem )
Attention
This function is not yet publicly available. To request access: reference this function in your code and attempt to link. The linker will report the exact symbol name. Submit a access request at https://github.com/LiteLDev/mcapi-requests/issues/new including the full symbol name.

◆ $ctor()

MCAPI void * SimpleSparseContainer::$ctor ( ::Container & backingContainer,
::SparseContainerBackingSetType backingSetType,
::std::unique_ptr<::ISparseContainerSetListener > sparseContainerSetListener,
::std::unique_ptr<::IPlayerContainerSetter > playerSetter )
Attention
This function is not yet publicly available. To request access: reference this function in your code and attempt to link. The linker will report the exact symbol name. Submit a access request at https://github.com/LiteLDev/mcapi-requests/issues/new including the full symbol name.

◆ $getItem()

MCAPI::ItemStack const & SimpleSparseContainer::$getItem ( int slot) const
Attention
This function is not yet publicly available. To request access: reference this function in your code and attempt to link. The linker will report the exact symbol name. Submit a access request at https://github.com/LiteLDev/mcapi-requests/issues/new including the full symbol name.

◆ $setItem()

MCAPI void SimpleSparseContainer::$setItem ( int modelSlot,
::ItemStack const & item )
Attention
This function is not yet publicly available. To request access: reference this function in your code and attempt to link. The linker will report the exact symbol name. Submit a access request at https://github.com/LiteLDev/mcapi-requests/issues/new including the full symbol name.

◆ $startOpen()

MCAPI void SimpleSparseContainer::$startOpen ( ::Player & player)
Attention
This function is not yet publicly available. To request access: reference this function in your code and attempt to link. The linker will report the exact symbol name. Submit a access request at https://github.com/LiteLDev/mcapi-requests/issues/new including the full symbol name.

◆ $stopOpen()

MCAPI void SimpleSparseContainer::$stopOpen ( ::Player & player)
Attention
This function is not yet publicly available. To request access: reference this function in your code and attempt to link. The linker will report the exact symbol name. Submit a access request at https://github.com/LiteLDev/mcapi-requests/issues/new including the full symbol name.

◆ $getContainerSize()

MCAPI int SimpleSparseContainer::$getContainerSize ( ) const
Attention
This function is not yet publicly available. To request access: reference this function in your code and attempt to link. The linker will report the exact symbol name. Submit a access request at https://github.com/LiteLDev/mcapi-requests/issues/new including the full symbol name.

◆ $getMaxStackSize()

MCAPI int SimpleSparseContainer::$getMaxStackSize ( ) const
Attention
This function is not yet publicly available. To request access: reference this function in your code and attempt to link. The linker will report the exact symbol name. Submit a access request at https://github.com/LiteLDev/mcapi-requests/issues/new including the full symbol name.

◆ $containerContentChanged()

MCAPI void SimpleSparseContainer::$containerContentChanged ( int slot)
Attention
This function is not yet publicly available. To request access: reference this function in your code and attempt to link. The linker will report the exact symbol name. Submit a access request at https://github.com/LiteLDev/mcapi-requests/issues/new including the full symbol name.

◆ $serverInitItemStackIds()

MCAPI void SimpleSparseContainer::$serverInitItemStackIds ( int containerSlot,
int count,
::std::function< void(int, ::ItemStack const &)> onNetIdChanged )
Attention
This function is not yet publicly available. To request access: reference this function in your code and attempt to link. The linker will report the exact symbol name. Submit a access request at https://github.com/LiteLDev/mcapi-requests/issues/new including the full symbol name.

◆ $vftableForContainerContentChangeListener()

static MCAPI void ** SimpleSparseContainer::$vftableForContainerContentChangeListener ( )
static
Attention
This function is not yet publicly available. To request access: reference this function in your code and attempt to link. The linker will report the exact symbol name. Submit a access request at https://github.com/LiteLDev/mcapi-requests/issues/new including the full symbol name.

◆ $vftableForContainer()

static MCAPI void ** SimpleSparseContainer::$vftableForContainer ( )
static
Attention
This function is not yet publicly available. To request access: reference this function in your code and attempt to link. The linker will report the exact symbol name. Submit a access request at https://github.com/LiteLDev/mcapi-requests/issues/new including the full symbol name.

◆ $vftable() [1/2]

static MCAPI void ** Container::$vftable ( )
staticinherited
Attention
This function is not yet publicly available. To request access: reference this function in your code and attempt to link. The linker will report the exact symbol name. Submit a access request at https://github.com/LiteLDev/mcapi-requests/issues/new including the full symbol name.

◆ $dtor()

MCAPI void ContainerContentChangeListener::$dtor ( )
inherited
Attention
This function is not yet publicly available. To request access: reference this function in your code and attempt to link. The linker will report the exact symbol name. Submit a access request at https://github.com/LiteLDev/mcapi-requests/issues/new including the full symbol name.

◆ $vftable() [2/2]

static MCAPI void ** ContainerContentChangeListener::$vftable ( )
staticinherited
Attention
This function is not yet publicly available. To request access: reference this function in your code and attempt to link. The linker will report the exact symbol name. Submit a access request at https://github.com/LiteLDev/mcapi-requests/issues/new including the full symbol name.

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