Engine > Game Engine

The main engine entry point. Owns the game state, manager registry, system registry, and phase map. The scene communicates with the engine exclusively through dispatch() and init() — nothing outside this class reads engine state directly.

Partial

All registered phase handlers keyed by phase name. Only phases listed here can receive dispatched actions or be targeted by a REDIRECT effect.

constructor

Instantiates GameState, ManagerRegistry, and SystemRegistry. Does not start a game session — call init() to bootstrap state.

dispatch

Routes an action to the currently active phase and returns the resulting effects. If the first effect is a REDIRECT, the action is forwarded to the target phase instead — this lets a phase hand off handling without triggering a cancel or any intermediate state changes. A redirect must always be the only effect returned by a phase.

init

Bootstraps a game session. Runs either NewGame or LoadGame depending on the action type, then initialises all manager and system caches. Returns the initial entity and tile data the scene needs to build its views.

save

Persists the current game session via SaveGame.




© Gamesanova 2026