mini_arcade_core.scenes.autoreg

Autoregistration utilities for mini arcade core. Allows automatic registration of Scene classes via decorators.

Functions

register_scene(scene_id)

Decorator to mark and register a Scene class under an id.

snapshot(→ Dict[str, ...)

Copy of current catalog (useful for tests).

clear()

Clear the current catalog (useful for tests).

Module Contents

mini_arcade_core.scenes.autoreg.register_scene(scene_id: str)[source]

Decorator to mark and register a Scene class under an id.

Parameters:

scene_id (str) – The unique identifier for the Scene class.

Raises:

ValueError – If the scene_id is already registered.

mini_arcade_core.scenes.autoreg.snapshot() Dict[str, Type[mini_arcade_core.scenes.scene.Scene]][source]

Copy of current catalog (useful for tests).

Returns:

A copy of the current scene catalog.

Return type:

Dict[str, Type[“Scene”]]

mini_arcade_core.scenes.autoreg.clear()[source]

Clear the current catalog (useful for tests).