R-Type
SceneManager.hpp
Go to the documentation of this file.
1 /*
2 ** EPITECH PROJECT, 2023
3 ** R-Type
4 ** File description:
5 ** SceneManager
6 */
7 
8 #ifndef SCENEMANAGER_HPP_
9 #define SCENEMANAGER_HPP_
10 #include <memory>
11 #include <string>
12 #include <unordered_map>
13 #include "utils/IScene.hpp"
14 
15 namespace GameEngine
16 {
19  {
20  public:
24  ~SceneManager() = default;
25 
29  void registerScene(const std::string &name, std::unique_ptr<IScene> &&scene);
32  void unregisterScene(const std::string &name);
33 
36  void loadScene(const std::string &name);
38  void unloadScene();
40  void updateCurrentScene();
41 
43 
44  private:
45  std::unordered_map<std::string, std::unique_ptr<IScene>> _scenes;
46  std::string _currentScene;
47  };
48 } // namespace GameEngine
49 
50 #endif /* !SCENEMANAGER_HPP_ */
Entity class for the game engine.
Definition: Entity.hpp:18
Class managing all the scenes for the game.
Definition: SceneManager.hpp:19
~SceneManager()=default
Default destructor.
void unregisterScene(const std::string &name)
Unregisters a scene.
Definition: SceneManager.cpp:19
SceneManager()
Default constructor.
Definition: SceneManager.hpp:22
void registerScene(const std::string &name, std::unique_ptr< IScene > &&scene)
Registers a new scene.
Definition: SceneManager.cpp:13
void loadScene(const std::string &name)
Loads a scene. Previous scene needs to be unregister before or the scenes will overlap.
Definition: SceneManager.cpp:26
void updateCurrentScene()
Updates the current scene.
Definition: SceneManager.cpp:48
void unloadScene()
Unloads the currently loaded scene.
Definition: SceneManager.cpp:33
void addEntityToCurrentSceneUnload(Entity entity)
Definition: SceneManager.cpp:41
Definition: AssetManager.hpp:15