|
Clutter Engine 0.0.1
|
Manages the levels within the game engine. More...
#include <LevelManager.h>
Public Member Functions | |
| LevelManager (std::vector< Level * > &pLevels, RendererGL *pRenderer, Physics *pPhysics) | |
| Constructs a LevelManager with a list of levels. | |
| ~LevelManager () | |
| Destructor for LevelManager. | |
| void | Update () |
| Updates the current level. | |
| void | LoadLevel (const std::string &levelName) |
| Loads a level by its name. | |
| Level * | GetCurrentLevel () const |
| Gets the currently active level. | |
| std::string | GetCurrentLevelName () const |
| Gets the name of the currently active level. | |
Manages the levels within the game engine.
This class is responsible for storing, loading, and updating levels. It maintains a map of level names to level pointers, and tracks the currently active level as well as the level to be loaded.
| LevelManager::LevelManager | ( | std::vector< Level * > & | pLevels, |
| RendererGL * | pRenderer, | ||
| Physics * | pPhysics ) |
Constructs a LevelManager with a list of levels.
| pLevels | Vector of pointers to levels to be managed. |
| pRenderer | Pointer to the renderer used by the levels. |
| pPhysics | Pointer to the physics engine used by the levels. |
|
inline |
Gets the currently active level.
|
inline |
Gets the name of the currently active level.
| void LevelManager::LoadLevel | ( | const std::string & | levelName | ) |
Loads a level by its name.
| levelName | The name of the level to load. |
Schedules the specified level to be loaded and sets it as the current level.
| void LevelManager::Update | ( | ) |
Updates the current level.
This function should be called every frame to update the active level.