Clutter Engine 0.0.1
Loading...
Searching...
No Matches
clt::LevelManager Class Reference

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.
 
LevelGetCurrentLevel () const
 Gets the currently active level.
 
std::string GetCurrentLevelName () const
 Gets the name of the currently active level.
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ LevelManager()

LevelManager::LevelManager ( std::vector< Level * > & pLevels,
RendererGL * pRenderer,
Physics * pPhysics )

Constructs a LevelManager with a list of levels.

Parameters
pLevelsVector of pointers to levels to be managed.
pRendererPointer to the renderer used by the levels.
pPhysicsPointer to the physics engine used by the levels.

Member Function Documentation

◆ GetCurrentLevel()

Level * clt::LevelManager::GetCurrentLevel ( ) const
inline

Gets the currently active level.

Returns
Pointer to the current level.

◆ GetCurrentLevelName()

std::string clt::LevelManager::GetCurrentLevelName ( ) const
inline

Gets the name of the currently active level.

Returns
Name of the current level.

◆ LoadLevel()

void LevelManager::LoadLevel ( const std::string & levelName)

Loads a level by its name.

Parameters
levelNameThe name of the level to load.

Schedules the specified level to be loaded and sets it as the current level.

◆ Update()

void LevelManager::Update ( )

Updates the current level.

This function should be called every frame to update the active level.


The documentation for this class was generated from the following files: