LeviLamina
Loading...
Searching...
No Matches
ScriptItemCustomComponentRegistry.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/core/string/HashedString.h"
7#include "mc/deps/core/utility/NonOwnerPointer.h"
8#include "mc/deps/core/utility/pub_sub/Subscription.h"
9#include "mc/deps/scripting/Version.h"
10#include "mc/deps/scripting/lifetime_registry/StrongTypedObjectHandle.h"
11#include "mc/deps/scripting/lifetime_registry/WeakTypedObjectHandle.h"
12#include "mc/deps/scripting/runtime/Result.h"
13#include "mc/scripting/modules/minecraft/events/ScriptItemCustomComponentClosureFlags.h"
14#include "mc/scripting/modules/minecraft/items/IScriptItemCustomComponentRegistry.h"
15#include "mc/world/item/registry/ItemRegistryRef.h"
16
17// auto generated forward declare list
18// clang-format off
19class Item;
23namespace ScriptModuleMinecraft { class IScriptItemCustomComponentSignalCollection; }
24namespace ScriptModuleMinecraft { class ScriptCustomComponentParameterCache; }
25namespace ScriptModuleMinecraft { class ScriptItemCustomComponentInterface; }
26namespace ScriptModuleMinecraft { class ScriptItemStack; }
27namespace ScriptModuleMinecraft { struct ScriptCustomComponentInvalidRegistryError; }
28namespace ScriptModuleMinecraft { struct ScriptCustomComponentParameters; }
29namespace ScriptModuleMinecraft { struct ScriptItemCustomComponentAlreadyRegisteredError; }
30namespace ScriptModuleMinecraft { struct ScriptItemCustomComponentReloadNewComponentError; }
31namespace ScriptModuleMinecraft { struct ScriptItemCustomComponentReloadNewEventError; }
32namespace ScriptModuleMinecraft { struct ScriptItemCustomComponentReloadVersionError; }
33namespace Scripting { class WeakLifetimeScope; }
34namespace cereal { struct ReflectionCtx; }
35// clang-format on
36
37namespace ScriptModuleMinecraft {
38
39class ScriptItemCustomComponentRegistry : public ::ScriptModuleMinecraft::IScriptItemCustomComponentRegistry {
40public:
41 // ScriptItemCustomComponentRegistry inner types declare
42 // clang-format off
43 struct ComponentInfo;
44 // clang-format on
45
46 // ScriptItemCustomComponentRegistry inner types define
48 public:
49 // member variables
50 // NOLINTBEGIN
51 ::ll::TypedStorage<1, 1, bool> mRegistered;
52 ::ll::TypedStorage<8, 40, ::Scripting::Version> mClosureFlagsVersion;
53 ::ll::TypedStorage<2, 2, ::ScriptModuleMinecraft::ScriptItemCustomComponentClosureFlags> mClosureFlags;
54 // NOLINTEND
55
56 public:
57 // member functions
58 // NOLINTBEGIN
59 MCAPI ~ComponentInfo();
60 // NOLINTEND
61
62 public:
63 // destructor thunk
64 // NOLINTBEGIN
65 MCFOLD void $dtor();
66 // NOLINTEND
67 };
68
69public:
70 // member variables
71 // NOLINTBEGIN
72 ::ll::TypedStorage<
73 8,
74 64,
75 ::std::unordered_map<::HashedString, ::ScriptModuleMinecraft::ScriptItemCustomComponentRegistry::ComponentInfo>>
76 mKnownComponents;
77 ::ll::TypedStorage<8, 8, ::ScriptDeferredEventCoordinator&> mDeferredEventCoordinator;
78 ::ll::TypedStorage<8, 16, ::ItemRegistryRef const> mItemRegistry;
79 ::ll::TypedStorage<8, 16, ::Bedrock::PubSub::Subscription> mItemRegistryInitSubscription;
80 ::ll::TypedStorage<8, 8, ::ScriptModuleMinecraft::ScriptCustomComponentParameterCache&> mParameterCache;
81 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::ScriptModuleMinecraft::IScriptItemCustomComponentSignalCollection>>
82 mSignals;
83 ::ll::TypedStorage<8, 24, ::Bedrock::NonOwnerPointer<::cereal::ReflectionCtx>> mCerealContext;
84 // NOLINTEND
85
86public:
87 // prevent constructor by default
88 ScriptItemCustomComponentRegistry& operator=(ScriptItemCustomComponentRegistry const&);
89 ScriptItemCustomComponentRegistry(ScriptItemCustomComponentRegistry const&);
90 ScriptItemCustomComponentRegistry();
91
92public:
93 // virtual functions
94 // NOLINTBEGIN
95 virtual ~ScriptItemCustomComponentRegistry() /*override*/;
96
97 virtual ::Scripting::Result<
98 void,
104 tryRegisterComponentV1(
105 ::HashedString const& componentName,
107 ) /*override*/;
108
109 virtual ::Scripting::Result<
110 void,
116 tryRegisterComponent(
117 ::HashedString const& componentName,
119 ) /*override*/;
120
121 virtual ::std::vector<::std::string_view> getValidComponentsForItem(
123 ) const /*override*/;
124
125 virtual ::Scripting::StrongTypedObjectHandle<::ScriptModuleMinecraft::ScriptCustomComponentParameters> const&
126 tryGetCustomComponentParametersForItem(
128 ::std::string_view componentName,
130 ) const /*override*/;
131
132 virtual ::ScriptDeferredEventListener& getEventListener() /*override*/;
133
134 virtual void setCerealContext(::cereal::ReflectionCtx& ctx) /*override*/;
135
136 virtual void _onReload() /*override*/;
137
138 virtual void _onScriptInitializationComplete() /*override*/;
139 // NOLINTEND
140
141public:
142 // member functions
143 // NOLINTBEGIN
144 MCAPI ScriptItemCustomComponentRegistry(
146 ::ScriptDeferredEventCoordinator& deferredEventCoordinator,
147 ::ItemRegistryRef itemRegistry,
148 ::std::unique_ptr<::ScriptModuleMinecraft::IScriptItemCustomComponentSignalCollection>&& signals,
150 );
151
152 MCAPI void _bindComponentToCereal(::HashedString const& compName);
153
154 MCAPI void _subscribeItemToComponents(::Item* item, ::std::unordered_set<::HashedString>& unusedComponents);
155
156 MCAPI void _subscribeItemsToComponents();
157
158 MCAPI ::Scripting::Result<
159 void,
165 _tryRegisterComponent(
166 ::HashedString const& componentName,
168 );
169 // NOLINTEND
170
171public:
172 // constructor thunks
173 // NOLINTBEGIN
174 MCAPI void* $ctor(
176 ::ScriptDeferredEventCoordinator& deferredEventCoordinator,
177 ::ItemRegistryRef itemRegistry,
178 ::std::unique_ptr<::ScriptModuleMinecraft::IScriptItemCustomComponentSignalCollection>&& signals,
180 );
181 // NOLINTEND
182
183public:
184 // destructor thunk
185 // NOLINTBEGIN
186 MCAPI void $dtor();
187 // NOLINTEND
188
189public:
190 // virtual function thunks
191 // NOLINTBEGIN
192 MCAPI ::Scripting::Result<
193 void,
199 $tryRegisterComponentV1(
200 ::HashedString const& componentName,
202 );
203
204 MCAPI ::Scripting::Result<
205 void,
211 $tryRegisterComponent(
212 ::HashedString const& componentName,
214 );
215
216 MCAPI ::std::vector<::std::string_view> $getValidComponentsForItem(
218 ) const;
219
220 MCAPI ::Scripting::StrongTypedObjectHandle<::ScriptModuleMinecraft::ScriptCustomComponentParameters> const&
221 $tryGetCustomComponentParametersForItem(
223 ::std::string_view componentName,
225 ) const;
226
227 MCAPI ::ScriptDeferredEventListener& $getEventListener();
228
229 MCAPI void $setCerealContext(::cereal::ReflectionCtx& ctx);
230
231 MCAPI void $_onReload();
232
233 MCAPI void $_onScriptInitializationComplete();
234
235
236 // NOLINTEND
237
238public:
239 // vftables
240 // NOLINTBEGIN
242
244
246 // NOLINTEND
247};
248
249} // namespace ScriptModuleMinecraft
Definition HashedString.h:5
Definition ItemRegistryRef.h:36
Definition Item.h:68
Definition ScriptDeferredEventCoordinator.h:18
Definition ScriptDeferredEventListener.h:10
Definition IScriptItemCustomComponentRegistry.h:20
Definition IScriptItemCustomComponentSignalCollection.h:18
Definition ScriptCustomComponentParameterCache.h:21
Definition ScriptItemCustomComponentInterface.h:15
Definition ScriptItemStack.h:32
Definition WeakLifetimeScope.h:7
Definition WeakTypedObjectHandle.h:8
Definition ScriptCustomComponentInvalidRegistryError.h:17
Definition ScriptCustomComponentParameters.h:15
Definition ScriptItemCustomComponentAlreadyRegisteredError.h:15
Definition ScriptItemCustomComponentRegistry.h:47
Definition ScriptItemCustomComponentReloadNewComponentError.h:15
Definition ScriptItemCustomComponentReloadNewEventError.h:15
Definition ScriptItemCustomComponentReloadVersionError.h:15
Definition ServerScriptManagerEvents.h:13
Definition ReflectionCtx.h:11
Definition ctx.h:5