1 #ifndef GAME_MANAGER_HPP 2 #define GAME_MANAGER_HPP 6 #include "ConfigParser.hpp" 7 #include "GameWorld.hpp" 52 void RegisterObject(std::shared_ptr<GameObject> obj,
bool isPermanent);
63 const std::string& path);
void LoadLevel(const std::string &path)
Loads the given level path.
Definition: GameManager.cpp:31
void LoadLevels()
Calls to parse the levels and sets shouldLoadLevel true.
Definition: GameManager.cpp:26
GameManager()
Constructs a GameManager.
Definition: GameManager.cpp:10
static GameManager & instance()
The singleton instance of the GameManager.
Definition: GameManager.cpp:13
void init()
Initializes the GameManager.
Definition: GameManager.cpp:19
std::vector< std::string > levelPaths
The list of level paths for loading assets.
Definition: GameManager.hpp:72
static void ReloadLevel()
Reloads the level by setting shouldLoadLevel true.
Definition: GameManager.cpp:46
int curLevel
The current level.
Definition: GameManager.hpp:75
std::shared_ptr< GameWorld > curWorld_
The current world for our GameManager.
Definition: GameManager.hpp:66
static void LoadNextLevel()
Increments the curLevel and sets shouldLoadLevel true.
Definition: GameManager.cpp:36
std::vector< std::shared_ptr< GameObject > > permanentObjs_
The permanent objects in our GameManager.
Definition: GameManager.hpp:69
void Update()
Updates the world and any other gameobjects controlled by the GameManager, and calls to load levels i...
Definition: GameManager.cpp:50
void shutdown()
Shuts down the GameManager, removing its reference to the currently loaded GameWorld and all GameObje...
Definition: GameManager.cpp:21
~GameManager()
Destructs a GameManager.
Definition: GameManager.cpp:11
This class manages the loading, rendering, and objects of our game as a singleton.
Definition: GameManager.hpp:13
static std::vector< std::shared_ptr< GameObject > > GetActiveObjects()
Gets the list of all active objects in our GameManager.
Definition: GameManager.cpp:64
bool shouldLoadLevel
Whether or not the GameManager should load the next level.
Definition: GameManager.hpp:78
GameManager & operator=(const GameManager &)=delete
Stop the compiler from generating methods to copy the object.