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:
Converts class name to snake_case for event name
Registers the event class in the global _EVENT_REGISTRY
Makes the event retrievable via get_event(name)
This eliminates manual registration boilerplate and ensures all events are discoverable at runtime.
Classes#
Base class for all events (systems) in the BAM-ECS architecture. |