babylon.engine.systems.event_template
Event Template System - Data-Driven Event Evaluation.
This system evaluates EventTemplates against the current WorldState and applies matching resolutions. It runs LAST in the system order to evaluate against the final tick state.
Sprint: Event Template System
Classes
|
System that evaluates and applies EventTemplates. |
- class babylon.engine.systems.event_template.EventTemplateSystem(templates=None)[source]
Bases:
SystemBaseSystem that evaluates and applies EventTemplates.
EventTemplates are data-driven definitions of recurring game events. This system evaluates templates against the current WorldState graph, selects the appropriate resolution, and applies effects.
The system runs after all other systems to evaluate against the final state of each tick.
- Parameters:
templates (list[EventTemplate] | None)
- name
The identifier of the system.
- __init__(templates=None)[source]
Initialize with optional list of templates.
- Parameters:
templates (
list[EventTemplate] |None) – Templates to evaluate. If None, starts with empty list.- Return type:
None
- add_template(template)[source]
Add a template to the system.
- Parameters:
template (
EventTemplate) – The EventTemplate to add.- Return type:
- add_templates(templates)[source]
Add multiple templates to the system.
- Parameters:
templates (
list[EventTemplate]) – List of EventTemplates to add.- Return type:
- property templates: list[EventTemplate]
Get the current list of templates.
- Returns:
List of EventTemplates registered with this system.
- step(graph, services, context)[source]
Evaluate templates and apply matching resolutions.
- Parameters:
graph (GraphProtocol) – Mutable graph representing WorldState.
services (ServicesProtocol) – ServicesProtocol with config, formulas, event_bus, database.
context (ContextType) – TickContext or dict with ‘tick’ (int) and optional metadata.
- Return type:
None