NamedEventDictionary Class

Summary

A dictionary which maps event names to callbacks.
Assembly
Animancer.dll
Namespace
Animancer
Interfaces
Base Types
  • Object
graph BT Type-->Base0["Object"] Type-.->Interface0["IDictionary<StringReference, Action>"] Type["NamedEventDictionary"] class Type type-node

Syntax

public class NamedEventDictionary : IDictionary<StringReference, Action>

Remarks

Documentation: Animancer Events

Properties

Name Value Summary
Count int
The number of items in this dictionary.
Keys Dictionary<StringReference, Action>.KeyCollection
The names in this dictionary.
this[StringReference] Action
Accesses a callback in this dictionary.
Values Dictionary<StringReference, Action>.ValueCollection
The values in this dictionary.

Methods

Name Value Summary
AddNew(StringReference, Action) void
Registers the `callback` with the `name` but throws an System.ArgumentException if something was already registered with the same `name`.
AddNew(StringReference, Action<string>) Action
Registers the `callback` with the `name` but throws an System.ArgumentException if something was already registered with the same `name`.

It will be invoked using System.Object.ToString on the Animancer.AnimancerEvent.CurrentParameter.
AddNew<T>(StringReference, Action<T>) Action
Registers the `callback` with the `name` but throws an System.ArgumentException if something was already registered with the same `name`.

It will be invoked using Animancer.AnimancerEvent.GetCurrentParameter``1 to get its parameter.
AddTo(StringReference, Action) void
Adds the `callback` to any existing ones registered with the `name`.
AddTo(StringReference, Action<string>) Action
Adds the `callback` to any existing ones registered with the `name`.

It will be invoked using System.Object.ToString on the Animancer.AnimancerEvent.CurrentParameter.
AddTo<T>(StringReference, Action<T>) Action
Adds the `callback` to any existing ones registered with the `name`.

It will be invoked using Animancer.AnimancerEvent.GetCurrentParameter``1 to get its parameter.
AssertNotEndEvent(StringReference) void
[Assert-Conditional] Throws an System.ArgumentException if the `name` is the Animancer.AnimancerEvent.EndEventName.
static
Clear() void
Removes everything from this dictionary.
ContainsKey(StringReference) bool
Are any callbacks registered for the `name`?
Get(StringReference) Action
Returns the callback registered using the `name`.
GetEnumerator() Dictionary<StringReference, Action>.Enumerator
Returns an enumerator to go through every item in this dictionary.
Remove(StringReference) bool
Removes all callbacks registered with the `name`.
Remove(StringReference, Action) bool
Removes a specific `callback` registered with the `name`.
Set(StringReference, Action) void
Registers the callback using the `name`, replacing anything previously registered.
TryGetValue(StringReference, Action) bool
Tries to get the `callback` registered with the `name` and returns true if successful.