Class ActionCloner
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
monsterMonsterTypeThe monster type to register the action for.
variantuintThe variant of the monster to register the action for.
virtualFunctionsIReadOnlyDictionary<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
TThe 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.