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