24 std::map<const std::string, std::unique_ptr<Scene>> scenes_;
25 void move_dont_destroy_on_load_objects(
Scene& next_scene)
const;
27 std::optional<std::reference_wrapper<Scene>> current_scene_;
28 std::optional<std::string> next_scene_name_;
Definition iEngineService.h:4
Represents a scene within the engine. A scene contains multiple GameObjects and manages their lifecyc...
Definition scene.h:19
Service responsible for managing scenes within the engine. This service allows for adding,...
Definition scene_service.h:22
bool is_running() const
Shows if the SceneService is currently running scenes.
Scene & add_scene(const std::string &name)
Adds a new scene with the given name.
std::set< std::string > contained_scene_names() const
Checks if a scene with the given name exists.
const std::string & fallback_scene() const
Gets the fallback scene name.
Scene & current_scene() const
Gets the current active scene.
static constexpr auto DEFAULT_SCENE_NAME
Definition scene_service.h:33
SceneService(const std::string &initial_scene_name)
SceneService & remove_scene(const std::string &name)
Removes the scene with the given name.
SceneService & add_scene_and_load(const std::string &name)
Adds a new scene with the given name and sets it as the next scene to load. The scene will be loaded ...
SceneService(const SceneService &)=delete
SceneService & operator=(const SceneService &)=delete
SceneService & set_fallback_scene(const std::string &name)
Sets the fallback scene name. The fallback scene is loaded if the requested scene to load does not ex...
void stop()
Stops the SceneService and the current scene.
void run_current()
This method runs the current scene its game loop directly.
SceneService & load_scene(const std::string &name)
set the scene with the given name as the next scene to load. The scene will be loaded at the end of t...