mini_arcade_core.scenes.systems.builtins.timers =============================================== .. py:module:: mini_arcade_core.scenes.systems.builtins.timers .. autoapi-nested-parse:: Reusable timed-state helpers for temporary gameplay states. Classes ------- .. autoapisummary:: mini_arcade_core.scenes.systems.builtins.timers.TimedState mini_arcade_core.scenes.systems.builtins.timers.TimedStateBinding mini_arcade_core.scenes.systems.builtins.timers.TimedStateSystem Functions --------- .. autoapisummary:: mini_arcade_core.scenes.systems.builtins.timers.activate_timed_state mini_arcade_core.scenes.systems.builtins.timers.clear_timed_state Module Contents --------------- .. py:class:: TimedState Mutable state for one temporary status window. .. py:attribute:: active :type: bool :value: False .. py:attribute:: remaining_seconds :type: float :value: 0.0 .. py:attribute:: tag :type: str :value: '' .. py:attribute:: payload :type: Any :value: None .. py:function:: activate_timed_state(state: TimedState, *, duration_seconds: float, tag: str = '', payload: Any = None) -> None Activate a timed state and reset its countdown. .. py:function:: clear_timed_state(state: TimedState) -> None Clear a timed state immediately. .. py:class:: TimedStateBinding Bases: :py:obj:`Generic`\ [\ :py:obj:`TCtx`\ ] Declarative timed-state decay rule. .. py:attribute:: state_getter :type: Callable[[TCtx], TimedState] .. py:attribute:: on_expired :type: Callable[[TCtx, TimedState], None] | None :value: None .. py:class:: TimedStateSystem Bases: :py:obj:`Generic`\ [\ :py:obj:`TCtx`\ ] Decay active timed states using frame dt. .. py:attribute:: name :type: str :value: 'common_timed_state' .. py:attribute:: phase :type: int .. py:attribute:: order :type: int :value: 16 .. py:attribute:: enabled_when :type: Callable[[TCtx], bool] .. py:attribute:: bindings :type: tuple[TimedStateBinding[TCtx], Ellipsis] :value: () .. py:method:: step(ctx: TCtx) -> None Advance active timed states by the current frame delta.