Table of Contents

Class GameEventBase<TListener, TCodeListener>

Namespace
ElectricDrill.AstraRpgFramework.Events
Assembly
com.electricdrill.astra-rpg-framework.Runtime.dll

Shared event dispatch base for parameterless and generic game events. It centralizes listener storage, snapshotting, registration-order delivery, and reentrancy handling.

public abstract class GameEventBase<TListener, TCodeListener> : ScriptableObject

Type Parameters

TListener

The MonoBehaviour-based listener type.

TCodeListener

The code listener delegate type.

Inheritance
object
GameEventBase<TListener, TCodeListener>
Derived

Methods

Dispatch<TInvoker>(TInvoker)

Dispatches the event to a snapshot of the current listeners in registration order. Subscribe/unsubscribe during a callback never mutates the active iteration. The non-reentrant path reuses snapshot buffers after warmup; reentrant raises allocate fresh buffers.

protected void Dispatch<TInvoker>(TInvoker invoker) where TInvoker : struct, GameEventBase<TListener, TCodeListener>.IDispatchInvoker

Parameters

invoker TInvoker

The invoker that calls the concrete listener signatures.

Type Parameters

TInvoker

The listener invoker for the concrete event arity.

RegisterCodeListener(TCodeListener)

Registers a code listener to be notified when this event is raised. Duplicate listeners are automatically prevented.

protected void RegisterCodeListener(TCodeListener listener)

Parameters

listener TCodeListener

The listener to register.

RegisterMonoListener(TListener)

Registers a MonoBehaviour-based listener to be notified when this event is raised. Duplicate listeners are automatically prevented.

protected void RegisterMonoListener(TListener listener)

Parameters

listener TListener

The listener to register.

UnregisterCodeListener(TCodeListener)

Unregisters a code listener so it will no longer be notified when this event is raised.

protected void UnregisterCodeListener(TCodeListener listener)

Parameters

listener TCodeListener

The listener to unregister.

UnregisterMonoListener(TListener)

Unregisters a MonoBehaviour-based listener so it will no longer be notified when this event is raised.

protected void UnregisterMonoListener(TListener listener)

Parameters

listener TListener

The listener to unregister.