simvx.core.hot_reload¶
Hot-reload system – watch script files for changes and reload them live.
On file change: serialize node state -> importlib.reload(module) -> instantiate new class -> restore state. Non-serializable state is warned and skipped.
Public API: from simvx.core.hot_reload import HotReloadManager
mgr = HotReloadManager(tree)
mgr.watch("game.py") # start watching a module file
mgr.poll() # call each frame (or on a timer)
Module Contents¶
Classes¶
Watches script files for changes and hot-reloads node classes. |
Data¶
API¶
- simvx.core.hot_reload.__all__¶
[‘HotReloadManager’]
- class simvx.core.hot_reload.HotReloadManager(tree: simvx.core.scene_tree.SceneTree, poll_interval: float = 0.5)[source]¶
Watches script files for changes and hot-reloads node classes.
Usage: mgr = HotReloadManager(tree) mgr.watch(“my_game.py”) # In your game loop: mgr.poll() # checks every poll_interval seconds
Initialization
- watch(file_path: str) None[source]¶
Start watching a Python file for changes.
Args: file_path: Path to a .py file. The corresponding module must be importable.