Table of Contents

Class ActionCloner

Namespace
SharpPluginLoader.Core.Actions
Assembly
SharpPluginLoader.Core.dll

Allows for the creation of custom actions for monsters.

public class ActionCloner
Inheritance
ActionCloner
Inherited Members

Methods

RegisterAction<T>(MonsterType, uint, IReadOnlyDictionary<int, Delegate>?)

Registers a custom action for a monster.

public static void RegisterAction<T>(MonsterType monster, uint variant, IReadOnlyDictionary<int, Delegate>? virtualFunctions = null) where T : CustomAction, new()

Parameters

monster MonsterType

The monster type to register the action for.

variant uint

The variant of the monster to register the action for.

virtualFunctions IReadOnlyDictionary<int, Delegate>

Additional virtual functions to override, keyed by their index in the vtable. Only needed for functions that CustomAction does not already expose. The delegates must be kept alive by the caller for as long as the action is registered.

Type Parameters

T

The CustomAction type to register. It must carry a CustomActionAttribute and have a public parameterless constructor.

Remarks

One instance of T is created per monster that receives the action, so instance state is never shared between monsters.