Class ReloadableScript
- Namespace
- RisingV.Scripting.RuntimeHost
- Assembly
- RisingV.Scripting.dll
Script wrapper that can be reloaded at runtime.
public class ReloadableScript : IScript<IScriptContext<ScriptData>>, IReloadableScript, IScript, IManageableLifecycle<ScriptManager>, IManageableLifecycle, IReloadable, IManageable<ScriptManager>, IManageable
- Inheritance
-
ReloadableScript
- Implements
- Inherited Members
- Extension Methods
Constructors
ReloadableScript(IScript<IScriptContext<ScriptData>>)
Script wrapper that can be reloaded at runtime.
public ReloadableScript(IScript<IScriptContext<ScriptData>> script)
Parameters
script
IScript<IScriptContext<ScriptData>>The script to wrap.
Properties
ClassNamespace
Gets the class name of the script, which is the name of the class that implements the script logic.
public string ClassNamespace { get; }
Property Value
Context
public IScriptContext<ScriptData> Context { get; }
Property Value
FileName
Gets the file name of the script, typically the script's source file name.
public string FileName { get; }
Property Value
FilePath
Gets the file path of the script, which includes the directory and file name.
public string FilePath { get; }
Property Value
LoaderOptions
Gets the class name of the script, which is the name of the class that implements the script logic.
public ScriptLoaderOptions? LoaderOptions { get; }
Property Value
Log
Gets the logger for the script, which is used for logging messages related to the script's execution
public ILogger Log { get; }
Property Value
Name
Gets the name of the script.
public string Name { get; }
Property Value
Methods
Initialize(ScriptManager, List<IPlugin>)
Initializes the lifecycle of the manager with a specific type.
public void Initialize(ScriptManager manager, List<IPlugin> plugins)
Parameters
manager
ScriptManagerplugins
List<IPlugin>
Load(ScriptManager, List<IPlugin>)
Loads the manager and its dependencies with a specific type.
public void Load(ScriptManager manager, List<IPlugin> plugins)
Parameters
manager
ScriptManagerplugins
List<IPlugin>
OnReload(ScriptManager, List<IPlugin>, ReloadReason)
Called when the manager is reloaded with a specific type. This can be used to handle any specific logic needed during a reload. This can also override the default reload behavior.
public bool OnReload(ScriptManager manager, List<IPlugin> plugins, ReloadReason reason)
Parameters
manager
ScriptManagerplugins
List<IPlugin>reason
ReloadReason
Returns
- bool
true to allow default reload behaviour, false to stop
Ready(ScriptManager, List<IPlugin>)
Prepares the manager for use with a specific type, typically after loading.
public void Ready(ScriptManager manager, List<IPlugin> plugins)
Parameters
manager
ScriptManagerplugins
List<IPlugin>
Reload(ScriptManager, List<IPlugin>, ReloadReason)
Reloads the manager and its dependencies with a specific type.
public void Reload(ScriptManager manager, List<IPlugin> plugins, ReloadReason reason)
Parameters
manager
ScriptManagerplugins
List<IPlugin>reason
ReloadReason
Terminate(ScriptManager, List<IPlugin>)
Terminates the manager and cleans up resources with a specific type.
public void Terminate(ScriptManager manager, List<IPlugin> plugins)
Parameters
manager
ScriptManagerplugins
List<IPlugin>
Unload(ScriptManager, List<IPlugin>)
Unloads the manager and its dependencies with a specific type.
public void Unload(ScriptManager manager, List<IPlugin> plugins)
Parameters
manager
ScriptManagerplugins
List<IPlugin>