Table of Contents

Method TryGetEvent

Namespace
Anvil.API
Assembly
NWN.Anvil.dll

TryGetEvent<TEvent>(out TEvent?)

Attempts to get the current running event.

public bool TryGetEvent<TEvent>(out TEvent? eventData) where TEvent : IEvent, new()

Parameters

eventData TEvent

When this method returns, contains the created event if the current event is a TEvent. Otherwise, returns the default value for TEvent.

Returns

bool

true if the current running script is a TEvent, otherwise false.

Type Parameters

TEvent

The expected event type. Only events attributed with Anvil.API.Events.GameEventAttribute are supported.