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) /*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 MCNAPI ContainerManagerModel(::ContainerID containerId, ::Player& player);
132
133 MCNAPI void _addContainer(::std::shared_ptr<::ContainerModel> containerModel);
134
135 MCNAPI bool _isPlayerInRangeOfPosition(::BlockPos const& blockPos, float pickRange) const;
136
137 MCNAPI void addDynamicContainer(::std::shared_ptr<::ContainerModel> model);
138
139 MCNAPI void postInit();
140 // NOLINTEND
141
142public:
143 // constructor thunks
144 // NOLINTBEGIN
145 MCNAPI void* $ctor(::ContainerID containerId, ::Player& player);
146 // NOLINTEND
147
148public:
149 // destructor thunk
150 // NOLINTBEGIN
151 MCNAPI void $dtor();
152 // NOLINTEND
153
154public:
155 // virtual function thunks
156 // NOLINTBEGIN
157 MCNAPI bool $tick();
158
159 MCNAPI ::SharedTypes::Legacy::ContainerType $getContainerType() const;
160
161 MCNAPI void $setContainerType(::SharedTypes::Legacy::ContainerType type);
162
163 MCNAPI ::Bedrock::PubSub::Subscription
164 $registerContainerTypeListener(::std::function<void(::SharedTypes::Legacy::ContainerType)> callback) const;
165
166 MCNAPI void $debitPlayerLevels(int levels);
167
168 MCNAPI bool $isCreativeMode() const;
169
170 MCNAPI bool $isClientSide() const;
171
172 MCNAPI bool $isServerAuthoritative() const;
173
174 MCNAPI bool $isValid(float pickRange);
175
177
178 MCNAPI void $setFullContainerSlot(int slot, ::FullContainerName const& name, ::ItemStack const& item, bool);
179
180 MCNAPI ::ItemStack const& $getFullContainerSlot(int slot, ::FullContainerName const& name) const;
181
182 MCNAPI void $broadcastChanges();
183 // NOLINTEND
184
185public:
186 // vftables
187 // NOLINTBEGIN
188 MCNAPI static void** $vftable();
189 // NOLINTEND
190};
Definition Publisher.h:8
Definition BlockPos.h:18
Definition ContainerManagerController.h:30
Definition ContainerManagerModel.h:29
MCAPI bool $isServerAuthoritative() const
MCAPI::Bedrock::PubSub::Subscription $registerContainerTypeListener(::std::function< void(::SharedTypes::Legacy::ContainerType)> callback) const
MCAPI bool $isClientSide() const
MCAPI void $serverInitItemStackIds()
MCAPI bool $isValid(float pickRange)
MCAPI bool _isPlayerInRangeOfPosition(::BlockPos const &blockPos, float pickRange) const
MCAPI void $setContainerType(::SharedTypes::Legacy::ContainerType type)
MCAPI void * $ctor(::ContainerID containerId, ::Player &player)
MCAPI::ItemStack const & $getFullContainerSlot(int slot, ::FullContainerName const &name) const
MCAPI void $debitPlayerLevels(int levels)
MCAPI void $broadcastChanges()
static MCAPI void ** $vftable()
MCAPI void postInit()
MCAPI bool $isCreativeMode() const
MCAPI void $setFullContainerSlot(int slot, ::FullContainerName const &name, ::ItemStack const &item, bool)
MCAPI ContainerManagerModel(::ContainerID containerId, ::Player &player)
MCAPI::SharedTypes::Legacy::ContainerType $getContainerType() const
MCAPI void _addContainer(::std::shared_ptr<::ContainerModel > containerModel)
MCAPI void addDynamicContainer(::std::shared_ptr<::ContainerModel > model)
Definition ContainerModel.h:25
Definition DynamicContainerTracker.h:20
Definition IContainerManager.h:16
Definition IContainerRegistryAccess.h:14
Definition ItemStack.h:25
Definition Player.h:119
Definition FullContainerName.h:8
Definition PlayerContainerRefresher.h:13