mini_arcade_core.scenes.systems¶
Scene system primitives.
Submodules¶
Attributes¶
Classes¶
Protocol for a system that operates within a given context. |
|
High-level execution buckets for scene systems. |
|
Structural contract for a bundle that expands into multiple systems. |
|
Pipeline for managing and executing systems in order. |
Package Contents¶
- class mini_arcade_core.scenes.systems.BaseSystem[source]¶
Bases:
Protocol,Generic[TSystemContext]Protocol for a system that operates within a given context.
- name: str¶
- phase: int¶
- order: int = 0¶
- enabled(ctx: TSystemContext) bool[source]¶
Determine if the system is enabled in the given context.
- Parameters:
ctx (TSystemContext) – The system context.
- Returns:
True if the system is enabled, False otherwise.
- Return type:
bool
- step(ctx: TSystemContext)[source]¶
Perform a single step of the system within the given context.
- Parameters:
ctx (TSystemContext) – The system context.
- mini_arcade_core.scenes.systems.TSystemContext¶
- class mini_arcade_core.scenes.systems.SystemPhase[source]¶
Bases:
enum.IntEnumHigh-level execution buckets for scene systems.
Keep values spaced to leave room for future insertions without churn.
- INPUT = 10¶
- CONTROL = 20¶
- SIMULATION = 30¶
- PRESENTATION = 40¶
- RENDERING = 50¶
- class mini_arcade_core.scenes.systems.SystemBundle[source]¶
Bases:
Protocol,Generic[mini_arcade_core.scenes.systems.base_system.TSystemContext]Structural contract for a bundle that expands into multiple systems.
- iter_systems() Iterable[mini_arcade_core.scenes.systems.base_system.BaseSystem[mini_arcade_core.scenes.systems.base_system.TSystemContext]][source]¶
Return the concrete systems that should be added to the pipeline.
- class mini_arcade_core.scenes.systems.SystemPipeline[source]¶
Bases:
Generic[mini_arcade_core.scenes.systems.base_system.TSystemContext]Pipeline for managing and executing systems in order.
- Variables:
(List[BaseSystem[TSystemContext]]) (systems) – List of systems in the pipeline.
- systems: List[mini_arcade_core.scenes.systems.base_system.BaseSystem[mini_arcade_core.scenes.systems.base_system.TSystemContext]] = []¶
- add(system: mini_arcade_core.scenes.systems.base_system.BaseSystem[mini_arcade_core.scenes.systems.base_system.TSystemContext] | mini_arcade_core.scenes.systems.system_bundle.SystemBundle[mini_arcade_core.scenes.systems.base_system.TSystemContext])[source]¶
Add a system to the pipeline and sort by order.
- Parameters:
system (BaseSystem[TSystemContext] | SystemBundle[TSystemContext]) – The system to add.
- extend(systems: Iterable[mini_arcade_core.scenes.systems.base_system.BaseSystem[mini_arcade_core.scenes.systems.base_system.TSystemContext] | mini_arcade_core.scenes.systems.system_bundle.SystemBundle[mini_arcade_core.scenes.systems.base_system.TSystemContext]])[source]¶
Extend the pipeline with multiple systems.
- Parameters:
systems (Iterable[BaseSystem[TSystemContext] | SystemBundle[TSystemContext]]) – An iterable of systems to add.
- step(ctx: mini_arcade_core.scenes.systems.base_system.TSystemContext)[source]¶
Execute a step for each system in the pipeline.
- Parameters:
ctx (TSystemContext) – The system context.