LeviLamina
Loading...
Searching...
No Matches
SimpleSparseContainer.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/world/Container.h"
7#include "mc/world/ContainerContentChangeListener.h"
8#include "mc/world/inventory/simulation/SparseContainerBackingSetType.h"
9
10// auto generated forward declare list
11// clang-format off
12class Actor;
15class ItemStack;
16// clang-format on
17
18class SimpleSparseContainer : public ::Container, public ::ContainerContentChangeListener {
19public:
20 // SimpleSparseContainer inner types define
21 using SparseContainerData = ::std::unordered_map<int, ::ItemStack>;
22
23public:
24 // member variables
25 // NOLINTBEGIN
26 ::ll::TypedStorage<8, 8, ::Container&> mBackingContainer;
27 ::ll::TypedStorage<4, 4, ::SparseContainerBackingSetType const> mBackingSetType;
28 ::ll::TypedStorage<8, 64, ::std::unordered_map<int, ::ItemStack>> mItems;
29 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::ISparseContainerSetListener>> mSparseContainerSetListener;
30 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::IPlayerContainerSetter>> mPlayerSetter;
31 // NOLINTEND
32
33public:
34 // prevent constructor by default
35 SimpleSparseContainer& operator=(SimpleSparseContainer const&);
36 SimpleSparseContainer(SimpleSparseContainer const&);
37 SimpleSparseContainer();
38
39public:
40 // virtual functions
41 // NOLINTBEGIN
42 virtual ~SimpleSparseContainer() /*override*/ = default;
43
44 virtual ::ItemStack const& getItem(int slot) const /*override*/;
45
46 virtual void setItem(int slot, ::ItemStack const& item) /*override*/;
47
48 virtual void startOpen(::Actor& actor) /*override*/;
49
50 virtual void stopOpen(::Actor& actor) /*override*/;
51
52 virtual int getContainerSize() const /*override*/;
53
54 virtual int getMaxStackSize() const /*override*/;
55
56 virtual void containerContentChanged(int slot) /*override*/;
57
58 virtual void serverInitItemStackIds(
59 int containerSlot,
60 int count,
61 ::std::function<void(int, ::ItemStack const&)> onNetIdChanged
62 ) /*override*/;
63 // NOLINTEND
64
65public:
66 // member functions
67 // NOLINTBEGIN
68 MCAPI SimpleSparseContainer(
69 ::Container& backingContainer,
70 ::SparseContainerBackingSetType backingSetType,
71 ::std::unique_ptr<::ISparseContainerSetListener> sparseContainerSetListener,
72 ::std::unique_ptr<::IPlayerContainerSetter> playerSetter
73 );
74
75 MCAPI void pushAllToBackingContainer();
76
77#ifdef LL_PLAT_C
78 MCAPI void setCreatedItem(int slot, ::ItemStack const& item);
79#endif
80 // NOLINTEND
81
82public:
83 // constructor thunks
84 // NOLINTBEGIN
85 MCAPI void* $ctor(
86 ::Container& backingContainer,
87 ::SparseContainerBackingSetType backingSetType,
88 ::std::unique_ptr<::ISparseContainerSetListener> sparseContainerSetListener,
89 ::std::unique_ptr<::IPlayerContainerSetter> playerSetter
90 );
91 // NOLINTEND
92
93public:
94 // virtual function thunks
95 // NOLINTBEGIN
96 MCAPI ::ItemStack const& $getItem(int slot) const;
97
98 MCAPI void $setItem(int slot, ::ItemStack const& item);
99
100 MCAPI void $startOpen(::Actor& actor);
101
102 MCAPI void $stopOpen(::Actor& actor);
103
104 MCAPI int $getContainerSize() const;
105
106 MCAPI int $getMaxStackSize() const;
107
108#ifdef LL_PLAT_S
109 MCAPI void $containerContentChanged(int slot);
110#else // LL_PLAT_C
111 MCFOLD void $containerContentChanged(int slot);
112#endif
113
114 MCFOLD void $serverInitItemStackIds(
115 int containerSlot,
116 int count,
117 ::std::function<void(int, ::ItemStack const&)> onNetIdChanged
118 );
119
120
121 // NOLINTEND
122
123public:
124 // vftables
125 // NOLINTBEGIN
126 MCAPI static void** $vftableForContainerContentChangeListener();
127
128 MCAPI static void** $vftableForContainer();
129 // NOLINTEND
130};
Definition Actor.h:113
Definition ContainerContentChangeListener.h:5
Definition IPlayerContainerSetter.h:10
Definition ISparseContainerSetListener.h:11
Definition ItemStack.h:26