Singleton class to handle scenes and the navigation between them.
More...
#include <SceneManager.hpp>
|
|
static std::unique_ptr< SceneManager > const & | instance () |
| |
|
static void | destruct () |
| | Destroys the instance.
|
| |
Singleton class to handle scenes and the navigation between them.
template<class SceneType >
| void SceneManager::createScene |
( |
std::string const & |
name, |
|
|
std::string const & |
xmlPath, |
|
|
bool |
goToScene = true |
|
) |
| |
Adds a scene to the map under the specified name.
- Parameters
-
| name | The name of the scene (its key in the map) |
| derivedSceneObject | The scene to be added. |
| goToScene | True if the new scene should become the current scene (i.e. navigated to immediately) |
| void SceneManager::drawCurrentScene |
( |
sf::RenderWindow & |
w | ) |
|
Calls the current scene's draw method
| std::string SceneManager::getCurrentScene |
( |
| ) |
|
Gets the name of the current scene (its key in the map of scenes)
- Returns
- The name of the current scene.
| void SceneManager::navigateToScene |
( |
std::string const & |
path | ) |
|
Sets the current scene to be path.
- Parameters
-
| path | The name of the scene to be navigated to. |
- Returns
- True if the path matched an existing scene.
| bool SceneManager::passEventToCurrentScene |
( |
sf::Event & |
theEvent | ) |
|
Calls handleEvent on the current scene, passing theEvent.
- Parameters
-
| theEvent | The event that will be passes to the current scene. |
- Returns
- True if the event has been processed and no further processing of this event is required. (i.e. event is used up)
| void SceneManager::updateCurrentScene |
( |
sf::Time const & |
elapsedTime | ) |
|
Calls the current scene's update method.
| std::thread SceneManager::mRequestThread |
|
private |
| std::map<std::string, std::unique_ptr<SceneProxy> > SceneManager::mScenes |
|
private |
A map of all scenes managed by the SceneManager. Each scene is identified by its name.
The documentation for this class was generated from the following file: