LeviLamina
Loading...
Searching...
No Matches
BaseContainerMenu.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/core/utility/pub_sub/Publisher.h"
7#include "mc/deps/shared_types/legacy/ContainerType.h"
8#include "mc/world/ContainerContentChangeListener.h"
9#include "mc/world/ContainerID.h"
10#include "mc/world/containers/managers/IContainerManager.h"
11
12// auto generated forward declare list
13// clang-format off
14class Container;
16class ItemStack;
17class Player;
19namespace Bedrock::PubSub { class Subscription; }
20namespace Bedrock::PubSub::ThreadModel { struct SingleThreaded; }
21// clang-format on
22
23class BaseContainerMenu : public ::ContainerContentChangeListener, public ::IContainerManager {
24public:
25 // member variables
26 // NOLINTBEGIN
27 ::ll::TypedStorage<8, 8, ::Player&> mPlayer;
28 ::ll::TypedStorage<8, 24, ::std::vector<::ItemStack>> mLastSlots;
29 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::PlayerContainerRefresher>> mContainerRefresher;
30 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::DynamicContainerTracker>> mDynamicContainerTracker;
31 ::ll::TypedStorage<1, 1, ::ContainerID> mContainerId;
32 ::ll::TypedStorage<1, 1, ::SharedTypes::Legacy::ContainerType> mContainerType;
33 ::ll::TypedStorage<4, 4, int> mTicksSinceLastCleanup;
34 ::ll::TypedStorage<
35 8,
36 8,
37 ::std::unique_ptr<::Bedrock::PubSub::Publisher<
38 void(::SharedTypes::Legacy::ContainerType),
40 0>>>
41 mContainerTypeSubscribers;
42 // NOLINTEND
43
44public:
45 // prevent constructor by default
46 BaseContainerMenu& operator=(BaseContainerMenu const&);
47 BaseContainerMenu(BaseContainerMenu const&);
48 BaseContainerMenu();
49
50public:
51 // virtual functions
52 // NOLINTBEGIN
53 virtual ~BaseContainerMenu() /*override*/;
54
55 virtual void removeSlot(int slot, int count) = 0;
56
57 virtual bool isSlotDirty(int slot);
58
59 virtual bool isResultSlot(int slot);
60
61 virtual void containerContentChanged(int slot) /*override*/;
62
63 virtual void serverInitItemStackIds() = 0;
64
65 virtual ::std::vector<::ItemStack> getItemCopies() const = 0;
66
67 virtual void setSlot(int, ::ItemStack const&, bool) = 0;
68
69 virtual ::ItemStack const& getSlot(int slot) const = 0;
70
71 virtual void setData(int id, int value) /*override*/;
72
73 virtual ::ContainerID getContainerId() const /*override*/;
74
75 virtual void setContainerId(::ContainerID id) /*override*/;
76
77 virtual ::SharedTypes::Legacy::ContainerType getContainerType() const /*override*/;
78
79 virtual void setContainerType(::SharedTypes::Legacy::ContainerType type) /*override*/;
80
81 virtual ::Bedrock::PubSub::Subscription
82 registerContainerTypeListener(::std::function<void(::SharedTypes::Legacy::ContainerType)> callback) const
83 /*override*/;
84
85 virtual void broadcastChanges() /*override*/;
86
87 virtual ::Container* _getContainer() const = 0;
88 // NOLINTEND
89
90public:
91 // member functions
92 // NOLINTBEGIN
93 MCAPI BaseContainerMenu(::Player& player, ::SharedTypes::Legacy::ContainerType containerType);
94
95 MCAPI void _markAndSweep();
96
97 MCAPI void _saveLastSlots(::Container* container);
98 // NOLINTEND
99
100public:
101 // constructor thunks
102 // NOLINTBEGIN
103 MCAPI void* $ctor(::Player& player, ::SharedTypes::Legacy::ContainerType containerType);
104 // NOLINTEND
105
106public:
107 // destructor thunk
108 // NOLINTBEGIN
109 MCAPI void $dtor();
110 // NOLINTEND
111
112public:
113 // virtual function thunks
114 // NOLINTBEGIN
115 MCFOLD bool $isSlotDirty(int slot);
116
117 MCFOLD bool $isResultSlot(int slot);
118
119 MCFOLD void $containerContentChanged(int slot);
120
121 MCFOLD void $setData(int id, int value);
122
123 MCFOLD ::ContainerID $getContainerId() const;
124
125 MCAPI void $setContainerId(::ContainerID id);
126
127 MCFOLD ::SharedTypes::Legacy::ContainerType $getContainerType() const;
128
129 MCAPI void $setContainerType(::SharedTypes::Legacy::ContainerType type);
130
131 MCAPI ::Bedrock::PubSub::Subscription
132 $registerContainerTypeListener(::std::function<void(::SharedTypes::Legacy::ContainerType)> callback) const;
133
134 MCAPI void $broadcastChanges();
135
136
137 // NOLINTEND
138
139public:
140 // vftables
141 // NOLINTBEGIN
142 MCAPI static void** $vftableForContainerContentChangeListener();
143
144 MCAPI static void** $vftableForIContainerManager();
145 // NOLINTEND
146};
Definition Publisher.h:8
Definition Subscription.h:10
Definition ContainerContentChangeListener.h:5
Definition Container.h:33
Definition DynamicContainerTracker.h:21
Definition IContainerManager.h:16
Definition ItemStack.h:26
Definition Player.h:129
Definition PlayerContainerRefresher.h:13