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
reportFailureAction<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
reportFailureisnull.
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
argsTArgs
Subscribe(AsyncGameEventHandler<TArgs>)
Registers handler.
public ISubscription Subscribe(AsyncGameEventHandler<TArgs> handler)
Parameters
handlerAsyncGameEventHandler<TArgs>
Returns
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
handlerisnull.
Subscribe(GameEventHandler<TArgs>)
Registers handler.
public ISubscription Subscribe(GameEventHandler<TArgs> handler)
Parameters
handlerGameEventHandler<TArgs>
Returns
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
handlerisnull.