Class Event<TArg0, TArg1, TArg2, TArg3>
A four argument event.
Namespace: FasterGames.Whiskey.Events
Assembly: cs.temp.dll.dll
Syntax
public abstract class Event<TArg0, TArg1, TArg2, TArg3> : EventBase
Type Parameters
Name | Description |
---|---|
TArg0 | Argument type 1 |
TArg1 | Argument type 2 |
TArg2 | Argument type 3 |
TArg3 | Argument type 4 |
Fields
Listeners
Storage for the bound listeners.
Declaration
protected readonly List<Action<TArg0, TArg1, TArg2, TArg3>> Listeners
Field Value
Type | Description |
---|---|
System.Collections.Generic.List<Action<TArg0, TArg1, TArg2, TArg3>> |
Properties
EventTypes
The argument types of the event.
Declaration
public override List<Type> EventTypes { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.List<Type> |
Overrides
ListenerCount
The number of currently listening listeners.
Declaration
public override int ListenerCount { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Overrides
Methods
AddListener(Action<TArg0, TArg1, TArg2, TArg3>)
Add a listener to be invoked when the event is raised with Raise(TArg0, TArg1, TArg2, TArg3).
Declaration
public void AddListener(Action<TArg0, TArg1, TArg2, TArg3> listener)
Parameters
Type | Name | Description |
---|---|---|
Action<TArg0, TArg1, TArg2, TArg3> | listener | listener |
Raise(TArg0, TArg1, TArg2, TArg3)
Raise the event, invoking all listeners.
Declaration
public void Raise(TArg0 arg0, TArg1 arg1, TArg2 arg2, TArg3 arg3)
Parameters
Type | Name | Description |
---|---|---|
TArg0 | arg0 | first argument |
TArg1 | arg1 | second argument |
TArg2 | arg2 | third argument |
TArg3 | arg3 | fourth argument |
Raise(Box<TArg0>, Box<TArg1>, Box<TArg2>, Box<TArg3>)
Raise the event with a box, invoking all listeners.
Declaration
public void Raise(Box<TArg0> arg0, Box<TArg1> arg1, Box<TArg2> arg2, Box<TArg3> arg3)
Parameters
Type | Name | Description |
---|---|---|
Box<TArg0> | arg0 | first argument, boxed |
Box<TArg1> | arg1 | second argument, boxed |
Box<TArg2> | arg2 | third argument, boxed |
Box<TArg3> | arg3 | fourth argument, boxed |
Remarks
The value inside the box will be used to raise the event.
RemoveListener(Action<TArg0, TArg1, TArg2, TArg3>)
Remove a listener, so it will no longer be invoked when the event is raised with Raise(TArg0, TArg1, TArg2, TArg3)
Declaration
public void RemoveListener(Action<TArg0, TArg1, TArg2, TArg3> listener)
Parameters
Type | Name | Description |
---|---|---|
Action<TArg0, TArg1, TArg2, TArg3> | listener | listener |
UnsafeRaise(Object[])
An unsafe (can fail at runtime) hook to raise events. Do not use.
Declaration
public override void UnsafeRaise(params object[] args)
Parameters
Type | Name | Description |
---|---|---|
System.Object[] | args | event arguments |
Overrides
Remarks
This exists to expose a hook for generic code (e.g. editors) that may want to invoke events knowing only the base type.