mini_arcade_core.scenes.systems.builtins.spawn ============================================== .. py:module:: mini_arcade_core.scenes.systems.builtins.spawn .. autoapi-nested-parse:: Reusable spawn and wave progression systems. Classes ------- .. autoapisummary:: mini_arcade_core.scenes.systems.builtins.spawn.SpawnBinding mini_arcade_core.scenes.systems.builtins.spawn.SpawnSystem mini_arcade_core.scenes.systems.builtins.spawn.WaveProgressionBinding mini_arcade_core.scenes.systems.builtins.spawn.WaveProgressionSystem Module Contents --------------- .. py:class:: SpawnBinding Bases: :py:obj:`Generic`\ [\ :py:obj:`TCtx`\ ] Declarative spawn rule for one spawn source. .. py:attribute:: should_spawn :type: Callable[[TCtx], bool] .. py:attribute:: spawn :type: Callable[[TCtx], SpawnResult] .. py:attribute:: on_spawned :type: Callable[[TCtx, tuple[mini_arcade_core.engine.entities.BaseEntity, Ellipsis]], None] | None :value: None .. py:attribute:: insert_into_world :type: bool :value: True .. py:class:: SpawnSystem Bases: :py:obj:`Generic`\ [\ :py:obj:`TCtx`\ ] Execute reusable spawn rules and insert spawned entities into the world. .. py:attribute:: name :type: str :value: 'common_spawn' .. py:attribute:: phase :type: int .. py:attribute:: order :type: int :value: 25 .. py:attribute:: enabled_when :type: Callable[[TCtx], bool] .. py:attribute:: bindings :type: tuple[SpawnBinding[TCtx], Ellipsis] :value: () .. py:method:: step(ctx: TCtx) -> None Execute the spawn rules for each binding. :param ctx: The context object passed to the system, typically containing references to the world, scene, and other relevant state. :type ctx: TCtx .. py:class:: WaveProgressionBinding Bases: :py:obj:`Generic`\ [\ :py:obj:`TCtx`\ ] Declarative wave/lap/round progression rule. .. py:attribute:: is_complete :type: Callable[[TCtx], bool] .. py:attribute:: can_progress :type: Callable[[TCtx], bool] .. py:attribute:: advance :type: Callable[[TCtx], None] | None :value: None .. py:attribute:: spawn_next :type: Callable[[TCtx], SpawnResult] | None :value: None .. py:attribute:: on_spawned :type: Callable[[TCtx, tuple[mini_arcade_core.engine.entities.BaseEntity, Ellipsis]], None] | None :value: None .. py:attribute:: insert_into_world :type: bool :value: True .. py:class:: WaveProgressionSystem Bases: :py:obj:`Generic`\ [\ :py:obj:`TCtx`\ ] Advance wave state and optionally spawn the next batch when complete. .. py:attribute:: name :type: str :value: 'common_wave_progression' .. py:attribute:: phase :type: int .. py:attribute:: order :type: int :value: 80 .. py:attribute:: enabled_when :type: Callable[[TCtx], bool] .. py:attribute:: bindings :type: tuple[WaveProgressionBinding[TCtx], Ellipsis] :value: () .. py:method:: step(ctx: TCtx) -> None For each binding, if can_progress and is_complete are both true, call advance and spawn_next (if provided). :param ctx: The context object passed to the system, typically containing references to the world, scene, and other relevant state. :type ctx: TCtx