event#

Event (System) base class definition.

This module defines the Event base class, which encapsulates economic logic that operates on roles and mutates simulation state. Events are the “systems” in the BAM-ECS architecture.

Design Notes#

  • All Events auto-register via __init_subclass__ hook

  • Event names are automatically converted from CamelCase to snake_case

  • Events execute in explicit order defined by Pipeline (no automatic sorting)

  • Events receive full Simulation instance for maximum flexibility

Auto-Registration#

When a class inherits from Event, __init_subclass__ automatically:

  1. Converts class name to snake_case for event name

  2. Registers the event class in the global _EVENT_REGISTRY

  3. Makes the event retrievable via get_event(name)

This eliminates manual registration boilerplate and ensures all events are discoverable at runtime.

See also

Role

Base class for roles (components) in BAM-ECS

Pipeline

Manages event execution order

registry

Global registries for events and roles

event()

Simplified decorator for defining events

Classes#

Event

Base class for all events (systems) in the BAM-ECS architecture.