template<typename TStateId> asge::game::Game abstract
Base for a concrete game: owns the asset/scene/VFS stack and a state::GameStateStack<TStateId>, and wires state Update() requests into stack transitions.
#include <Game.hpp>Inherits from asge::game::details::IGame.
Inheritance
classDiagram
class N1["asge::game::Game"]
class N2["asge::game::details::IGame"]
N2 <|-- N1
click N1 href "classasge_1_1game_1_1Game.html"
click N2 href "classasge_1_1game_1_1details_1_1IGame.html"
Collaboration
classDiagram
class N7["asge::audio::AudioDevice"]
class N3["asge::filesystem::VirtualFileSystem"]
class N1["asge::game::Game"]
class N4["asge::game::asset::AssetManager"]
class N2["asge::game::details::IGame"]
class N8["asge::game::project::ProjectData"]
class N5["asge::game::scene::SceneManager"]
class N6["asge::video::IRenderer"]
N2 <|-- N1
N1 --> N3 : m_Vfs
N1 --> N4 : m_Assets
N1 --> N5 : m_SceneManager
N1 --> N6 : m_Renderer
N1 --> N7 : m_AudioDev
N1 --> N8 : m_Project
click N7 href "classasge_1_1audio_1_1AudioDevice.html"
click N3 href "classasge_1_1filesystem_1_1VirtualFileSystem.html"
click N1 href "classasge_1_1game_1_1Game.html"
click N4 href "classasge_1_1game_1_1asset_1_1AssetManager.html"
click N2 href "classasge_1_1game_1_1details_1_1IGame.html"
click N8 href "structasge_1_1game_1_1project_1_1ProjectData.html"
click N5 href "classasge_1_1game_1_1scene_1_1SceneManager.html"
click N6 href "classasge_1_1video_1_1IRenderer.html"
A derived class implements CreateState() (one case per TStateId) and calls SetInitialState() from its own constructor to seed the stack. States are cached by id in m_StateCache the first time each is needed — CreateState() only runs once per id unless InvalidateState() evicts it — so Push/Pop between the same two states doesn't reconstruct them each time.
Public Types
using StateType = state::IGameState< TStateId >using Transition = state::Transition< TStateId >Protected Attributes
Private Attributes
Private Member Functions
Returns inId's cached state, creating it via CreateState() on first use.
Applies one state's requested Push/Pop/Replace to m_States, or flags a Quit for QuitRequested(); TransitionKind::None is a no-op.
Protected Member Functions
Constructs the state for inId; called at most once per id unless InvalidateState() runs.
Seeds the stack with inId as the bottom (and initially only) state.
Evicts inId's cached state, so the next transition to it calls CreateState() again.
Public Member Functions
explicit Game(video::IRenderer &inRenderer, audio::AudioDevice &inAudioDev) noexceptBoolResult LoadScene(str::String const &inPath) noexceptLoads inPath as the active scene and resolves its Sprite/Animation assets through m_Renderer.
BoolResult LoadProject(filesystem::Path const &inPath) noexceptLoads a .asgeproject written by the editor: mounts its VFS entries (skipping missing directories with a warning) and loads its main scene (the first listed one if none is set) as the active one.
Fails with SceneError::EmptyProject if the project lists no scenes.
project::ProjectData const & GetProject() const noexceptThe project last passed to LoadProject(); empty before that.
Called for every system event Application's loop pumps.
True once a state has requested a clean shutdown via TransitionKind::Quit.