Table of Contents

Class EventBus

Namespace
MoonBark.GridPlacement.Core.Events
Assembly
MoonBark.GridPlacement.Core.dll

Base class for domain event buses providing common publish functionality. Engine-agnostic implementation with no Godot or Unity dependencies.

Purpose: Reduces boilerplate by providing a common Publish method pattern that invokes event handlers if they are subscribed.

Architecture Boundary: Core ECS systems → EventBus implementations → Engine adapter bridges

public abstract class EventBus
Inheritance
EventBus
Derived
Inherited Members

Remarks

Each derived EventBus should:

  1. Define public event fields: public event Action<TEvent>? OnX;
  2. Call Publish(event) in each Publish method to trigger subscribers

Methods

Publish<TEvent>(Action<TEvent>?, TEvent)

Publishes an event by invoking its handler if subscribed.

protected static void Publish<TEvent>(Action<TEvent>? handler, TEvent @event)

Parameters

handler Action<TEvent>

The event handler delegate

event TEvent

The event instance to pass to handlers

Type Parameters

TEvent

The event type to publish