Show / Hide Table of Contents

Class Event<TArg0>

A single argument event.

Inheritance
System.Object
EventBase
Event<TArg0>
BoolEvent
FloatEvent
IntEvent
StringEvent
TransformEvent
Vector2Event
Vector3Event
Namespace: FasterGames.Whiskey.Events
Assembly: cs.temp.dll.dll
Syntax
public abstract class Event<TArg0> : EventBase
Type Parameters
Name Description
TArg0

Argument type

Fields

Listeners

Storage for the bound listeners.

Declaration
protected readonly List<Action<TArg0>> Listeners
Field Value
Type Description
System.Collections.Generic.List<Action<TArg0>>

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
EventBase.EventTypes

ListenerCount

The number of currently listening listeners.

Declaration
public override int ListenerCount { get; }
Property Value
Type Description
System.Int32
Overrides
EventBase.ListenerCount

Methods

AddListener(Action<TArg0>)

Add a listener to be invoked when the event is raised with Raise(TArg0).

Declaration
public void AddListener(Action<TArg0> listener)
Parameters
Type Name Description
Action<TArg0> listener

listener

Raise(TArg0)

Raise the event, invoking all listeners.

Declaration
public void Raise(TArg0 arg0)
Parameters
Type Name Description
TArg0 arg0

first argument

Raise(Box<TArg0>)

Raise the event with a box, invoking all listeners.

Declaration
public void Raise(Box<TArg0> arg0)
Parameters
Type Name Description
Box<TArg0> arg0

first argument, boxed

Remarks

The value inside the box will be used to raise the event.

RemoveListener(Action<TArg0>)

Remove a listener, so it will no longer be invoked when the event is raised with Raise(TArg0)

Declaration
public void RemoveListener(Action<TArg0> listener)
Parameters
Type Name Description
Action<TArg0> 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
EventBase.UnsafeRaise(Object[])
Remarks

This exists to expose a hook for generic code (e.g. editors) that may want to invoke events knowing only the base type.

In This Article
Back to top Copyright FasterGames ©