Skip to content
LeviMC
English
AutoLightDark
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/script_core/lifetime_registry/scripting/StrongTypedObjectHandle.h"
10#include "mc/deps/script_core/lifetime_registry/scripting/WeakTypedObjectHandle.h"
11#include "mc/deps/script_core/runtime/scripting/Result.h"
12#include "mc/deps/script_core/scripting/Version.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
22namespace ScriptModuleMinecraft { class IScriptItemCustomComponentSignalCollection; }
23namespace ScriptModuleMinecraft { class ScriptCustomComponentParameterCache; }
24namespace ScriptModuleMinecraft { class ScriptItemCustomComponentInterface; }
25namespace ScriptModuleMinecraft { class ScriptItemStack; }
26namespace ScriptModuleMinecraft { struct ScriptCustomComponentInvalidRegistryError; }
27namespace ScriptModuleMinecraft { struct ScriptCustomComponentParameters; }
28namespace ScriptModuleMinecraft { struct ScriptItemCustomComponentAlreadyRegisteredError; }
29namespace ScriptModuleMinecraft { struct ScriptItemCustomComponentReloadNewComponentError; }
30namespace ScriptModuleMinecraft { struct ScriptItemCustomComponentReloadNewEventError; }
31namespace ScriptModuleMinecraft { struct ScriptItemCustomComponentReloadVersionError; }
32namespace Scripting { class WeakLifetimeScope; }
33namespace cereal { struct ReflectionCtx; }
34// clang-format on
35
36namespace ScriptModuleMinecraft {
37
38class ScriptItemCustomComponentRegistry : public ::ScriptModuleMinecraft::IScriptItemCustomComponentRegistry {
39public:
40 // ScriptItemCustomComponentRegistry inner types declare
41 // clang-format off
42 struct ComponentInfo;
43 // clang-format on
44
45 // ScriptItemCustomComponentRegistry inner types define
47 public:
48 // member variables
49 // NOLINTBEGIN
50 ::ll::TypedStorage<1, 1, bool> mRegistered;
51 ::ll::TypedStorage<8, 40, ::Scripting::Version> mClosureFlagsVersion;
52 ::ll::TypedStorage<2, 2, ::ScriptModuleMinecraft::ScriptItemCustomComponentClosureFlags> mClosureFlags;
53 // NOLINTEND
54 };
55
56public:
57 // member variables
58 // NOLINTBEGIN
59 ::ll::TypedStorage<
60 8,
61 64,
62 ::std::unordered_map<::HashedString, ::ScriptModuleMinecraft::ScriptItemCustomComponentRegistry::ComponentInfo>>
63 mKnownComponents;
64 ::ll::TypedStorage<8, 8, ::ScriptDeferredEventCoordinator&> mDeferredEventCoordinator;
65 ::ll::TypedStorage<8, 16, ::ItemRegistryRef const> mItemRegistry;
66 ::ll::TypedStorage<8, 16, ::Bedrock::PubSub::Subscription> mItemRegistryInitSubscription;
67 ::ll::TypedStorage<8, 8, ::ScriptModuleMinecraft::ScriptCustomComponentParameterCache&> mParameterCache;
68 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::ScriptModuleMinecraft::IScriptItemCustomComponentSignalCollection>>
69 mSignals;
70 ::ll::TypedStorage<8, 24, ::Bedrock::NonOwnerPointer<::cereal::ReflectionCtx>> mCerealContext;
71 // NOLINTEND
72
73public:
74 // prevent constructor by default
75 ScriptItemCustomComponentRegistry& operator=(ScriptItemCustomComponentRegistry const&);
76 ScriptItemCustomComponentRegistry(ScriptItemCustomComponentRegistry const&);
77 ScriptItemCustomComponentRegistry();
78
79public:
80 // virtual functions
81 // NOLINTBEGIN
82 virtual ~ScriptItemCustomComponentRegistry() /*override*/ = default;
83
84 virtual ::Scripting::Result<
85 void,
91 tryRegisterComponentV1(
92 ::HashedString const& componentName,
94 ) /*override*/;
95
96 virtual ::Scripting::Result<
97 void,
103 tryRegisterComponent(
104 ::HashedString const& componentName,
106 ) /*override*/;
107
108 virtual ::std::vector<::std::string_view> getValidComponentsForItem(
110 ) const /*override*/;
111
112 virtual ::Scripting::StrongTypedObjectHandle<::ScriptModuleMinecraft::ScriptCustomComponentParameters> const&
113 tryGetCustomComponentParametersForItem(
115 ::std::string_view componentName,
117 ) const /*override*/;
118
119 virtual ::ScriptDeferredEventListener& getEventListener() /*override*/;
120
121 virtual void setCerealContext(::cereal::ReflectionCtx& ctx) /*override*/;
122
123 virtual void _onReload() /*override*/;
124
125 virtual void _onScriptInitializationComplete() /*override*/;
126 // NOLINTEND
127
128public:
129 // member functions
130 // NOLINTBEGIN
133 ::ScriptDeferredEventCoordinator& deferredEventCoordinator,
134 ::ItemRegistryRef itemRegistry,
135 ::std::unique_ptr<::ScriptModuleMinecraft::IScriptItemCustomComponentSignalCollection>&& signals,
137 );
138
140
141 MCNAPI ::Scripting::Result<
142 void,
149 ::HashedString const& componentName,
151 );
152 // NOLINTEND
153
154public:
155 // constructor thunks
156 // NOLINTBEGIN
157 MCNAPI void* $ctor(
159 ::ScriptDeferredEventCoordinator& deferredEventCoordinator,
160 ::ItemRegistryRef itemRegistry,
161 ::std::unique_ptr<::ScriptModuleMinecraft::IScriptItemCustomComponentSignalCollection>&& signals,
163 );
164 // NOLINTEND
165
166public:
167 // virtual function thunks
168 // NOLINTBEGIN
169 MCNAPI ::Scripting::Result<
170 void,
177 ::HashedString const& componentName,
179 );
180
181 MCNAPI ::Scripting::Result<
182 void,
189 ::HashedString const& componentName,
191 );
192
193 MCNAPI ::std::vector<::std::string_view> $getValidComponentsForItem(
195 ) const;
196
197 MCNAPI ::Scripting::StrongTypedObjectHandle<::ScriptModuleMinecraft::ScriptCustomComponentParameters> const&
200 ::std::string_view componentName,
202 ) const;
203
204 MCNAPI ::ScriptDeferredEventListener& $getEventListener();
205
207
208 MCNAPI void $_onReload();
209
211
212
213 // NOLINTEND
214};
215
216} // namespace ScriptModuleMinecraft
Definition HashedString.h:5
Definition ItemRegistryRef.h:36
Definition ScriptDeferredEventCoordinator.h:18
Definition ScriptDeferredEventListener.h:10
Definition IScriptItemCustomComponentRegistry.h:20
Definition IScriptItemCustomComponentSignalCollection.h:18
Definition ScriptCustomComponentParameterCache.h:21
Definition ScriptItemCustomComponentInterface.h:15
MCAPI ::Scripting::Result< void, ::ScriptModuleMinecraft::ScriptCustomComponentInvalidRegistryError, ::ScriptModuleMinecraft::ScriptItemCustomComponentAlreadyRegisteredError, ::ScriptModuleMinecraft::ScriptItemCustomComponentReloadVersionError, ::ScriptModuleMinecraft::ScriptItemCustomComponentReloadNewEventError, ::ScriptModuleMinecraft::ScriptItemCustomComponentReloadNewComponentError > $tryRegisterComponentV1(::HashedString const &componentName, ::ScriptModuleMinecraft::ScriptItemCustomComponentInterface &&closures)
MCAPI ::Scripting::Result< void, ::ScriptModuleMinecraft::ScriptCustomComponentInvalidRegistryError, ::ScriptModuleMinecraft::ScriptItemCustomComponentAlreadyRegisteredError, ::ScriptModuleMinecraft::ScriptItemCustomComponentReloadVersionError, ::ScriptModuleMinecraft::ScriptItemCustomComponentReloadNewEventError, ::ScriptModuleMinecraft::ScriptItemCustomComponentReloadNewComponentError > _tryRegisterComponent(::HashedString const &componentName, ::ScriptModuleMinecraft::ScriptItemCustomComponentInterface &&closures)
MCAPI ScriptItemCustomComponentRegistry(::ServerScriptManagerEvents &events, ::ScriptDeferredEventCoordinator &deferredEventCoordinator, ::ItemRegistryRef itemRegistry, ::std::unique_ptr<::ScriptModuleMinecraft::IScriptItemCustomComponentSignalCollection > &&signals, ::ScriptModuleMinecraft::ScriptCustomComponentParameterCache &parameterCache)
MCAPI::ScriptDeferredEventListener & $getEventListener()
MCAPI void $setCerealContext(::cereal::ReflectionCtx &ctx)
MCAPI void * $ctor(::ServerScriptManagerEvents &events, ::ScriptDeferredEventCoordinator &deferredEventCoordinator, ::ItemRegistryRef itemRegistry, ::std::unique_ptr<::ScriptModuleMinecraft::IScriptItemCustomComponentSignalCollection > &&signals, ::ScriptModuleMinecraft::ScriptCustomComponentParameterCache &parameterCache)
MCAPI ::Scripting::StrongTypedObjectHandle<::ScriptModuleMinecraft::ScriptCustomComponentParameters > const & $tryGetCustomComponentParametersForItem(::Scripting::WeakTypedObjectHandle<::ScriptModuleMinecraft::ScriptItemStack > itemHandle, ::std::string_view componentName, ::Scripting::WeakLifetimeScope const &scope) const
MCAPI ::std::vector<::std::string_view > $getValidComponentsForItem(::Scripting::WeakTypedObjectHandle<::ScriptModuleMinecraft::ScriptItemStack > itemHandle) const
MCAPI ::Scripting::Result< void, ::ScriptModuleMinecraft::ScriptCustomComponentInvalidRegistryError, ::ScriptModuleMinecraft::ScriptItemCustomComponentAlreadyRegisteredError, ::ScriptModuleMinecraft::ScriptItemCustomComponentReloadVersionError, ::ScriptModuleMinecraft::ScriptItemCustomComponentReloadNewEventError, ::ScriptModuleMinecraft::ScriptItemCustomComponentReloadNewComponentError > $tryRegisterComponent(::HashedString const &componentName, ::ScriptModuleMinecraft::ScriptItemCustomComponentInterface &&closures)
Definition ScriptItemStack.h:30
Definition WeakLifetimeScope.h:12
Definition WeakTypedObjectHandle.h:8
Definition ScriptCustomComponentInvalidRegistryError.h:17
Definition ScriptCustomComponentParameters.h:15
Definition ScriptItemCustomComponentAlreadyRegisteredError.h:15
Definition ScriptItemCustomComponentRegistry.h:46
Definition ScriptItemCustomComponentReloadNewComponentError.h:15
Definition ScriptItemCustomComponentReloadNewEventError.h:15
Definition ScriptItemCustomComponentReloadVersionError.h:15
Definition ServerScriptManagerEvents.h:13
Definition ReflectionCtx.h:11
Definition ctx.h:5