LeviLamina
Loading...
Searching...
No Matches
ContainerManagerModel.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/game_refs/WeakRef.h"
8#include "mc/deps/shared_types/legacy/ContainerType.h"
9#include "mc/world/ContainerID.h"
10#include "mc/world/containers/managers/IContainerManager.h"
11#include "mc/world/inventory/network/ContainerScreenContext.h"
12
13// auto generated forward declare list
14// clang-format off
15class BlockPos;
17class ContainerModel;
20class ItemStack;
21class Player;
24namespace Bedrock::PubSub { class Subscription; }
25namespace Bedrock::PubSub::ThreadModel { struct MultiThreaded; }
26namespace Bedrock::PubSub::ThreadModel { struct SingleThreaded; }
27// clang-format on
28
30public:
31 // ContainerManagerModel inner types define
34
35public:
36 // member variables
37 // NOLINTBEGIN
38 ::ll::TypedStorage<8, 8, ::gsl::not_null<::std::unique_ptr<::PlayerContainerRefresher>>> mContainerRefresher;
39 ::ll::TypedStorage<8, 16, ::gsl::not_null<::std::shared_ptr<::DynamicContainerTracker>>> mDynamicContainerTracker;
40 ::ll::TypedStorage<8, 16, ::WeakRef<::IContainerRegistryAccess>> mRegistryAccess;
41 ::ll::TypedStorage<8, 8, ::Player&> mPlayer;
42 ::ll::TypedStorage<8, 24, ::std::vector<::ItemStack>> mLastSlots;
43 ::ll::TypedStorage<1, 1, ::ContainerID> mContainerId;
44 ::ll::TypedStorage<1, 1, ::SharedTypes::Legacy::ContainerType> mContainerType;
45 ::ll::TypedStorage<
46 8,
47 8,
48 ::std::unique_ptr<::Bedrock::PubSub::Publisher<
49 void(::SharedTypes::Legacy::ContainerType),
51 0>>>
52 mContainerTypeSubscribers;
53 ::ll::TypedStorage<
54 8,
55 64,
56 ::std::unordered_map<::ContainerManagerController const*, ::std::function<void(::ContainerManagerModel&)>>>
57 mInformControllerOfDestructionCallbacks;
58 ::ll::TypedStorage<8, 40, ::ContainerScreenContext> mScreenContext;
59 ::ll::TypedStorage<8, 64, ::std::unordered_map<::std::string, ::std::shared_ptr<::ContainerModel>>> mContainers;
61 mOnDynamicContainerChangePublisher;
62 // NOLINTEND
63
64public:
65 // prevent constructor by default
69
70public:
71 // virtual functions
72 // NOLINTBEGIN
73 // vIndex: 0
74 virtual ~ContainerManagerModel() /*override*/;
75
76 // vIndex: 14
77 virtual bool tick();
78
79 // vIndex: 1
80 virtual ::ContainerID getContainerId() const /*override*/;
81
82 // vIndex: 2
83 virtual void setContainerId(::ContainerID id) /*override*/;
84
85 // vIndex: 3
86 virtual ::SharedTypes::Legacy::ContainerType getContainerType() const /*override*/;
87
88 // vIndex: 4
89 virtual void setContainerType(::SharedTypes::Legacy::ContainerType type) /*override*/;
90
91 // vIndex: 5
92 virtual ::Bedrock::PubSub::Subscription
93 registerContainerTypeListener(::std::function<void(::SharedTypes::Legacy::ContainerType)> callback) const
94 /*override*/;
95
96 // vIndex: 15
97 virtual void debitPlayerLevels(int levels);
98
99 // vIndex: 16
100 virtual bool isCreativeMode() const;
101
102 // vIndex: 17
103 virtual bool isClientSide() const;
104
105 // vIndex: 18
106 virtual bool isServerAuthoritative() const;
107
108 // vIndex: 19
109 virtual bool isValid(float pickRange);
110
111 // vIndex: 6
112 virtual void serverInitItemStackIds() /*override*/;
113
114 // vIndex: 11
115 virtual void
116 setFullContainerSlot(int slot, ::FullContainerName const& name, ::ItemStack const& item, bool) /*override*/;
117
118 // vIndex: 12
119 virtual ::ItemStack const& getFullContainerSlot(int slot, ::FullContainerName const& name) const /*override*/;
120
121 // vIndex: 13
122 virtual void broadcastChanges() /*override*/;
123
124 // vIndex: 20
125 virtual ::ContainerScreenContext _postInit() = 0;
126 // NOLINTEND
127
128public:
129 // member functions
130 // NOLINTBEGIN
131 MCAPI ContainerManagerModel(::ContainerID containerId, ::Player& player);
132
133 MCAPI void _addContainer(::std::shared_ptr<::ContainerModel> containerModel);
134
135 MCAPI bool _isPlayerInRangeOfPosition(::BlockPos const& blockPos, float pickRange) const;
136
137 MCAPI void addDynamicContainer(::std::shared_ptr<::ContainerModel> model);
138
139 MCAPI void postInit();
140 // NOLINTEND
141
142public:
143 // constructor thunks
144 // NOLINTBEGIN
145 MCAPI void* $ctor(::ContainerID containerId, ::Player& player);
146 // NOLINTEND
147
148public:
149 // destructor thunk
150 // NOLINTBEGIN
151 MCAPI void $dtor();
152 // NOLINTEND
153
154public:
155 // virtual function thunks
156 // NOLINTBEGIN
157 MCFOLD bool $tick();
158
159 MCFOLD ::ContainerID $getContainerId() const;
160
161 MCFOLD void $setContainerId(::ContainerID id);
162
163 MCFOLD ::SharedTypes::Legacy::ContainerType $getContainerType() const;
164
165 MCAPI void $setContainerType(::SharedTypes::Legacy::ContainerType type);
166
167 MCAPI ::Bedrock::PubSub::Subscription
168 $registerContainerTypeListener(::std::function<void(::SharedTypes::Legacy::ContainerType)> callback) const;
169
170 MCAPI void $debitPlayerLevels(int levels);
171
172 MCAPI bool $isCreativeMode() const;
173
174 MCAPI bool $isClientSide() const;
175
176 MCAPI bool $isServerAuthoritative() const;
177
178 MCAPI bool $isValid(float pickRange);
179
180 MCAPI void $serverInitItemStackIds();
181
182 MCAPI void $setFullContainerSlot(int slot, ::FullContainerName const& name, ::ItemStack const& item, bool);
183
184 MCAPI ::ItemStack const& $getFullContainerSlot(int slot, ::FullContainerName const& name) const;
185
186 MCAPI void $broadcastChanges();
187 // NOLINTEND
188
189public:
190 // vftables
191 // NOLINTBEGIN
192 MCAPI static void** $vftable();
193 // NOLINTEND
194};
Definition Publisher.h:8
Definition BlockPos.h:18
Definition ContainerManagerController.h:30
Definition ContainerManagerModel.h:29
Definition ContainerModel.h:25
Definition DynamicContainerTracker.h:20
Definition IContainerManager.h:16
Definition IContainerRegistryAccess.h:14
Definition ItemStack.h:25
Definition Player.h:120
Definition FullContainerName.h:8
Definition PlayerContainerRefresher.h:13