31#include <utility/logging/loggable.hpp>
32#include <utility/logging/default_logger.hpp>
34#include <utility/ressource_provider.hpp>
36#include <utility/engine.hpp>
38#include "guillaume/scene.hpp"
40#include "guillaume/ecs/component_registry.hpp"
41#include "guillaume/ecs/entity_registry.hpp"
42#include "guillaume/ecs/system_registry.hpp"
44#include "guillaume/local_storage.hpp"
45#include "guillaume/session_storage.hpp"
80 requires AllDistinct<DefaultSceneType, SceneTypes...>
82 public utility::logging::Loggable<
83 SceneManager<DefaultSceneType, SceneTypes...>,
84 utility::logging::DefaultLogger>
101 std::shared_ptr<utility::RessourceProvider> ressourceProvider,
102 utility::Engine &engine);
204 template<InheritFromScene SceneType>
void addScene(
void);
207 std::shared_ptr<utility::RessourceProvider>
209 std::map<std::type_index, std::unique_ptr<Scene>>
212 std::type_index _activeSceneType;
217 utility::Engine &_engine;
228 void transitionTo(std::type_index nextType);
233#include "guillaume/scene_manager.tpp"
Key-value storage kept in a file: the place for data that must be found again at the next start (pref...
void enterActiveScene(void)
Enter the active scene: call its onEnter(), then place its entities in front of the engine's current ...
void addScene(void)
Create the instance of one scene type and keep it.
bool hasActiveScene(void) const noexcept
Tell whether an active scene is selected.
SceneManager(std::shared_ptr< utility::RessourceProvider > ressourceProvider, utility::Engine &engine)
Create one instance of every scene type and make DefaultSceneType the active one.
std::vector< std::type_index > getRegisteredSceneTypes(void) const
List the scene types this manager holds.
~SceneManager(void)
Destroy the manager and every scene. onExit() is not called on the active scene.
Scene * getActiveScene(void)
Get the active scene.
bool hasScenes(void) const noexcept
Tell whether the manager holds at least one scene.
ecs::ComponentRegistry & getActiveComponentRegistry(void)
Get the component registry of the active scene.
void processSceneTransition(void)
Carry out the switch requested by the active scene with Scene::goToScene, if any.
ecs::EntityRegistry & getActiveEntityRegistry(void)
Get the entity registry of the active scene.
void switchToScene(void)
Switch to another scene immediately, without waiting for the end of the frame.
One screen of the application: it owns the entities shown and the components that hold their state.
Key-value storage that lasts as long as the process: the place for data shared between scenes that ne...
Stores every component of a scene, per component type and per entity identifier, and knows which ones...
Owns entities and gives the systems the list of entities to visit.
Constrains a parameter pack to types that are all different.
Constrains a template parameter to a type derived from Scene.
A C++20 UI framework for desktop and XR, built as an entity-component-system.