Nox Engine
 
Loading...
Searching...
No Matches
SceneManager.h
Go to the documentation of this file.
1
6#pragma once
7
8#include "Scene.h"
9
10extern Manager manager;
11
17public:
18 SceneManager() {}
19
20 ~SceneManager() {}
21
26 void loadScene(std::string id);
31 void loadScene(int buildIndex);
35 void loadNextScene();
39 void loadPrevScene();
40
50 void addScene(Scene* scene);
55 void removeBgScene(int layer);
56
60 void updateScene();
65 void callSceneEvents(SDL_Event& event);
69 void drawScene();
73 void reloadScene();
74
75private:
76 Scene* scenes[MAX_SCENE_COUNT];
77 Scene* bgScenes[MAX_SCENE_COUNT];
78 Scene* currentScene;
79 int currentSceneIndex;
80
81 Scene* getSceneById(std::string id);
82};
const int MAX_SCENE_COUNT
Maximum number of scenes the manager can hold.
Definition Constants.h:36
ComponentID getComponentTypeID() noexcept
Gets the unique ID for a given component type.
Definition ECS.h:39
Defines the abstract base class for all game scenes.
Manages all entities and their groups within the game.
Definition ECS.h:234
Manages the lifecycle of all scenes in the game.
Definition SceneManager.h:16
void loadPrevScene()
Loads the scene with the previous sequential build index.
Definition SceneManager.cpp:47
void reloadScene()
Calls the reload method on the current active scene.
Definition SceneManager.cpp:93
void callSceneEvents(SDL_Event &event)
Forwards SDL events to the current active scene(s).
Definition SceneManager.cpp:76
void updateScene()
Calls the update method on the current active scene(s).
Definition SceneManager.cpp:68
void addScene(Scene *scene)
Adds a scene to the manager's collection.
Definition SceneManager.cpp:55
void loadScene(std::string id)
Loads a scene by its string identifier.
Definition SceneManager.cpp:4
void removeBgScene(int layer)
Removes a background (panel) scene from a specific layer.
Definition SceneManager.cpp:63
void loadNextScene()
Loads the scene with the next sequential build index.
Definition SceneManager.cpp:43
void drawScene()
Calls the draw method on the current active scene(s).
Definition SceneManager.cpp:85
Scene * getCurrentScene()
Gets a pointer to the currently active primary scene.
Definition SceneManager.cpp:51
An abstract class representing a distinct part of the game, like a main menu or a level.
Definition Scene.h:16