Interface IGameEvent<TArgs>
- Namespace
- SkyrimForge.Events
- Assembly
- SkyrimForge.dll
A game event to which a plugin can subscribe.
public interface IGameEvent<TArgs> where TArgs : struct
Type Parameters
TArgs
- Extension Methods
Remarks
Members can be called on any thread.
A game object in an event's arguments, such as an Actor, addresses the game's memory, so read it while the handler runs.
To use a form later, store its FormId and look it up again.
Methods
Subscribe(AsyncGameEventHandler<TArgs>)
Registers handler, whose task the event does not await.
ISubscription Subscribe(AsyncGameEventHandler<TArgs> handler)
Parameters
handlerAsyncGameEventHandler<TArgs>
Returns
Remarks
A later raise can call the handler again while an earlier task is pending. A handler that throws, or whose task faults, is dropped and not called again, even after a later load. The exception is written to its plugin's log. A canceled task does not drop the handler.
Exceptions
- ArgumentNullException
handlerisnull.
Subscribe(GameEventHandler<TArgs>)
Registers handler.
ISubscription Subscribe(GameEventHandler<TArgs> handler)
Parameters
handlerGameEventHandler<TArgs>
Returns
Remarks
A handler that throws is dropped and not called again, even after a later load. The exception is written to its plugin's log.
Exceptions
- ArgumentNullException
handlerisnull.