mini_arcade_core.scenes.systems.builtins.timers¶
Reusable timed-state helpers for temporary gameplay states.
Classes¶
Mutable state for one temporary status window. |
|
Declarative timed-state decay rule. |
|
Decay active timed states using frame dt. |
Functions¶
|
Activate a timed state and reset its countdown. |
|
Clear a timed state immediately. |
Module Contents¶
- class mini_arcade_core.scenes.systems.builtins.timers.TimedState[source]¶
Mutable state for one temporary status window.
- active: bool = False¶
- remaining_seconds: float = 0.0¶
- tag: str = ''¶
- payload: Any = None¶
- mini_arcade_core.scenes.systems.builtins.timers.activate_timed_state(state: TimedState, *, duration_seconds: float, tag: str = '', payload: Any = None) None[source]¶
Activate a timed state and reset its countdown.
- mini_arcade_core.scenes.systems.builtins.timers.clear_timed_state(state: TimedState) None[source]¶
Clear a timed state immediately.
- class mini_arcade_core.scenes.systems.builtins.timers.TimedStateBinding[source]¶
Bases:
Generic[TCtx]Declarative timed-state decay rule.
- state_getter: Callable[[TCtx], TimedState]¶
- on_expired: Callable[[TCtx, TimedState], None] | None = None¶