LeviLamina
Loading...
Searching...
No Matches
ScriptPlugin.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/core/resource/PackIdVersion.h"
7#include "mc/deps/core/resource/ResourceInformation.h"
8#include "mc/deps/scripting/runtime/IDependencyLoader.h"
9#include "mc/deps/scripting/runtime/IPrinter.h"
10#include "mc/deps/scripting/script_engine/Capabilities.h"
11#include "mc/deps/scripting/script_engine/ModuleDescriptor.h"
12#include "mc/deps/scripting/script_engine/ScriptContext.h"
13#include "mc/resources/MinEngineVersion.h"
14#include "mc/scripting/PluginExecutionGroup.h"
15#include "mc/scripting/ScriptRuntimeType.h"
16
17// auto generated forward declare list
18// clang-format off
23namespace Scripting { struct BaseError; }
24namespace Scripting { struct ContextId; }
25namespace Scripting { struct ScriptData; }
26// clang-format on
27
29public:
30 // member variables
31 // NOLINTBEGIN
32 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::IScriptPluginSource>> mPluginSource;
33 ::ll::TypedStorage<8, 96, ::Scripting::ModuleDescriptor> mModuleDescriptor;
34 ::ll::TypedStorage<8, 24, ::std::vector<::Scripting::ModuleDescriptor>> mModuleDependencies;
35 ::ll::TypedStorage<1, 1, ::Scripting::Capabilities> mCapabilities;
36 ::ll::TypedStorage<8, 32, ::MinEngineVersion const> mMinEngineVersion;
37 ::ll::TypedStorage<8, 48, ::PackIdVersion> mPackId;
38 ::ll::TypedStorage<8, 32, ::std::string> mRuntimeName;
39 ::ll::TypedStorage<4, 4, ::ScriptRuntimeType> mRuntimeType;
40 ::ll::TypedStorage<8, 32, ::std::string> mRuntimeFileExt;
41 ::ll::TypedStorage<8, 32, ::std::string> mMainScriptFilePath;
42 ::ll::TypedStorage<8, 24, ::std::vector<::std::string>> mScriptPaths;
43 ::ll::TypedStorage<8, 32, ::Scripting::ScriptContext> mContext;
44 ::ll::TypedStorage<1, 1, ::PluginExecutionGroup const> mExecutionGroup;
45 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::ScriptPluginHandleCounter>> mHandleCounter;
46 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::ScriptPrintLogger>> mPrintLogger;
47 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::ScriptSentryLogger>> mSentryLogger;
48 // NOLINTEND
49
50public:
51 // prevent constructor by default
53
54public:
55 // virtual functions
56 // NOLINTBEGIN
57 // vIndex: 0
58 virtual ~ScriptPlugin() /*override*/;
59
60 // vIndex: 1
61 virtual ::std::optional<::Scripting::ScriptData> onLoadScript(::std::string const& name) /*override*/;
62
63 // vIndex: 1
64 virtual void onInfo(::Scripting::ContextId contextId, ::std::string_view message) const /*override*/;
65
66 // vIndex: 2
67 virtual void onWarn(::Scripting::ContextId contextId, ::std::string_view message) const /*override*/;
68
69 // vIndex: 3
70 virtual void onError(::Scripting::ContextId contextId, ::std::string_view message) const /*override*/;
71
72 // vIndex: 4
73 virtual void onException(
74 ::Scripting::ContextId contextId,
75 ::Scripting::BaseError const& error,
76 ::entt::meta_any const& errorAny
77 ) const /*override*/;
78
79 // vIndex: 5
80 virtual bool shouldPrintException(
81 ::Scripting::ContextId contextId,
82 ::Scripting::BaseError const& error,
83 ::entt::meta_any const& errorAny
84 ) const /*override*/;
85
86 // vIndex: 6
87 virtual void onPromiseRejection(
88 ::Scripting::ContextId contextId,
89 ::Scripting::BaseError const& error,
90 ::entt::meta_any const& errorAny,
91 bool isHandled
92 ) const /*override*/;
93 // NOLINTEND
94
95public:
96 // member functions
97 // NOLINTBEGIN
98 MCAPI ScriptPlugin(
99 ::std::shared_ptr<::IScriptPluginSource> pluginSource,
101 ::std::vector<::Scripting::ModuleDescriptor>&& moduleDependencies,
102 ::Scripting::Capabilities&& capabilities,
103 ::MinEngineVersion const& minEngineVersion,
104 ::PackIdVersion const& packId,
105 ::std::string const& runtimeName,
106 ::std::string const& mainScriptFilePath,
107 ::ResourceInformation::ResourceType pluginType,
108 ::PluginExecutionGroup executionGroup
109 );
110
111 MCAPI ::std::optional<::Scripting::ScriptData> _loadScript(::std::string const& fileName);
112
113 MCAPI void enableHandleCounter(bool enabled);
114 // NOLINTEND
115
116public:
117 // constructor thunks
118 // NOLINTBEGIN
119 MCAPI void* $ctor(
120 ::std::shared_ptr<::IScriptPluginSource> pluginSource,
122 ::std::vector<::Scripting::ModuleDescriptor>&& moduleDependencies,
123 ::Scripting::Capabilities&& capabilities,
124 ::MinEngineVersion const& minEngineVersion,
125 ::PackIdVersion const& packId,
126 ::std::string const& runtimeName,
127 ::std::string const& mainScriptFilePath,
128 ::ResourceInformation::ResourceType pluginType,
129 ::PluginExecutionGroup executionGroup
130 );
131 // NOLINTEND
132
133public:
134 // destructor thunk
135 // NOLINTBEGIN
136 MCAPI void $dtor();
137 // NOLINTEND
138
139public:
140 // virtual function thunks
141 // NOLINTBEGIN
142 MCAPI ::std::optional<::Scripting::ScriptData> $onLoadScript(::std::string const& name);
143
144 MCAPI void $onInfo(::Scripting::ContextId contextId, ::std::string_view message) const;
145
146 MCAPI void $onWarn(::Scripting::ContextId contextId, ::std::string_view message) const;
147
148 MCAPI void $onError(::Scripting::ContextId contextId, ::std::string_view message) const;
149
150 MCAPI void $onException(
151 ::Scripting::ContextId contextId,
152 ::Scripting::BaseError const& error,
153 ::entt::meta_any const& errorAny
154 ) const;
155
156 MCAPI bool $shouldPrintException(
157 ::Scripting::ContextId contextId,
158 ::Scripting::BaseError const& error,
159 ::entt::meta_any const& errorAny
160 ) const;
161
162 MCAPI void $onPromiseRejection(
163 ::Scripting::ContextId contextId,
164 ::Scripting::BaseError const& error,
165 ::entt::meta_any const& errorAny,
166 bool isHandled
167 ) const;
168 // NOLINTEND
169
170public:
171 // vftables
172 // NOLINTBEGIN
173 MCNAPI static void** $vftableForIDependencyLoader();
174
175 MCNAPI static void** $vftableForIPrinter();
176 // NOLINTEND
177};
Definition IScriptPluginSource.h:10
Definition MinEngineVersion.h:10
Definition ScriptPluginHandleCounter.h:14
Definition ScriptPlugin.h:28
static MCAPI void ** $vftableForIPrinter()
static MCAPI void ** $vftableForIDependencyLoader()
Definition ScriptPrintLogger.h:14
Definition ScriptSentryLogger.h:15
Definition IDependencyLoader.h:12
Definition IPrinter.h:13
Definition PackIdVersion.h:10
Definition BaseError.h:12
Definition Capabilities.h:7
Definition ContextId.h:7
Definition ModuleDescriptor.h:7