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, int) = 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) 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 _saveLastSlots(::Container* container);
96 // NOLINTEND
97
98public:
99 // constructor thunks
100 // NOLINTBEGIN
101 MCAPI void* $ctor(::Player& player, ::SharedTypes::Legacy::ContainerType containerType);
102 // NOLINTEND
103
104public:
105 // destructor thunk
106 // NOLINTBEGIN
107 MCAPI void $dtor();
108 // NOLINTEND
109
110public:
111 // virtual function thunks
112 // NOLINTBEGIN
113 MCFOLD bool $isSlotDirty(int slot);
114
115 MCFOLD bool $isResultSlot(int slot);
116
117 MCFOLD void $containerContentChanged(int slot);
118
119 MCFOLD void $setData(int id, int value);
120
121 MCFOLD ::ContainerID $getContainerId() const;
122
123 MCAPI void $setContainerId(::ContainerID id);
124
125 MCFOLD ::SharedTypes::Legacy::ContainerType $getContainerType() const;
126
127 MCAPI void $setContainerType(::SharedTypes::Legacy::ContainerType type);
128
129 MCAPI ::Bedrock::PubSub::Subscription
130 $registerContainerTypeListener(::std::function<void(::SharedTypes::Legacy::ContainerType)> callback) const;
131
132 MCAPI void $broadcastChanges();
133
134
135 // NOLINTEND
136
137public:
138 // vftables
139 // NOLINTBEGIN
140 MCAPI static void** $vftableForContainerContentChangeListener();
141
142 MCAPI static void** $vftableForIContainerManager();
143 // NOLINTEND
144};
Definition Publisher.h:8
Definition Subscription.h:10
Definition ContainerContentChangeListener.h:5
Definition Container.h:33
Definition DynamicContainerTracker.h:20
Definition IContainerManager.h:16
Definition ItemStack.h:26
Definition Player.h:125
Definition PlayerContainerRefresher.h:13