Table of Contents

Class GameEvent<TArgs>

Namespace
SkyrimForge
Assembly
SkyrimForge.dll

The subscribers behind an IGameEvent<TArgs>. Whoever raises the event uses this concrete type.

public sealed class GameEvent<TArgs> : IGameEvent<TArgs> where TArgs : struct

Type Parameters

TArgs
Inheritance
GameEvent<TArgs>
Implements
IGameEvent<TArgs>
Inherited Members

Constructors

GameEvent(Action<Exception>)

Creates an event with no subscribers.

public GameEvent(Action<Exception> reportFailure)

Parameters

reportFailure Action<Exception>

Receives the exception from a subscriber that threw. That subscriber is dropped before it is reported, so a persistently failing one is reported once.

Exceptions

ArgumentNullException

reportFailure is null.

Methods

Raise(TArgs)

Invokes every current subscriber. One that throws is dropped and reported rather than left to stop the subscribers after it, or to reach the game and end the process.

public void Raise(TArgs args)

Parameters

args TArgs

Subscribe(AsyncGameEventHandler<TArgs>)

Registers handler.

public ISubscription Subscribe(AsyncGameEventHandler<TArgs> handler)

Parameters

handler AsyncGameEventHandler<TArgs>

Returns

ISubscription

Remarks

A handler that throws, or whose task faults, is dropped and not called again, a later load included. The exception is written to its plugin's log.

Exceptions

ArgumentNullException

handler is null.

Subscribe(GameEventHandler<TArgs>)

Registers handler.

public ISubscription Subscribe(GameEventHandler<TArgs> handler)

Parameters

handler GameEventHandler<TArgs>

Returns

ISubscription

Remarks

A handler that throws, or whose task faults, is dropped and not called again, a later load included. The exception is written to its plugin's log.

Exceptions

ArgumentNullException

handler is null.