Table of Contents

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

string

Context

public IScriptContext<ScriptData> Context { get; }

Property Value

IScriptContext<ScriptData>

FileName

Gets the file name of the script, typically the script's source file name.

public string FileName { get; }

Property Value

string

FilePath

Gets the file path of the script, which includes the directory and file name.

public string FilePath { get; }

Property Value

string

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

ScriptLoaderOptions

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

ILogger

Name

Gets the name of the script.

public string Name { get; }

Property Value

string

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 ScriptManager
plugins 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 ScriptManager
plugins 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 ScriptManager
plugins 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 ScriptManager
plugins 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 ScriptManager
plugins 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 ScriptManager
plugins 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 ScriptManager
plugins List<IPlugin>