Class Event
An argument-less event.
Namespace: FasterGames.Whiskey.Events
Assembly: cs.temp.dll.dll
Syntax
public abstract class Event : EventBase
Fields
Listeners
Storage for the bound listeners.
Declaration
protected readonly List<Action> Listeners
Field Value
Type | Description |
---|---|
System.Collections.Generic.List<Action> |
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)
Add a listener to be invoked when the event is raised with Raise().
Declaration
public void AddListener(Action listener)
Parameters
Type | Name | Description |
---|---|---|
Action | listener | listener |
Raise()
Raise the event, invoking all listeners.
Declaration
public void Raise()
RemoveListener(Action)
Remove a listener, so it will no longer be invoked when the event is raised with Raise()
Declaration
public void RemoveListener(Action listener)
Parameters
Type | Name | Description |
---|---|---|
Action | 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.