Nymph Game Engine
Chaiscript based Game Engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Engine Class Reference

Class for engine. More...

#include <engine.h>

Inheritance diagram for Engine:

Public Member Functions

 Engine ()=delete
 
 Engine (const std::string &config_path)
 Engine constructor. More...
 
virtual ~Engine ()=default
 Engine destructor. More...
 
void addScene (std::shared_ptr< Game::Scene > scene) noexcept
 Adds a scene to the engine. More...
 
std::shared_ptr< Game::ScenefindSceneByName (const std::string &name) noexcept
 Finds a scene by name. More...
 
std::map< std::shared_ptr
< Game::Scene >, bool > 
getScenes () const noexcept
 Gets the scenes. More...
 
void activateScene (const std::string &name)
 Activates a scene by name. More...
 
void deactivateScene (const std::string &name)
 Deactivates a scene by name. More...
 
std::vector< std::string > getSceneNames () const noexcept
 Gets the scene names. More...
 
std::vector< std::string > getActiveSceneNames () const noexcept
 Gets the active scene names. More...
 
void timeToExit () noexcept
 This is to signal the engine that it is time to shut down. More...
 
void setup ()
 Sets up the engine. More...
 
void mainLoop ()
 Triggers the main loop for the engine. More...
 
void cleanUp ()
 Cleans up before exiting. More...
 

Detailed Description

Class for engine.

Constructor & Destructor Documentation

Engine::Engine ( )
delete
Engine::Engine ( const std::string &  config_path)

Engine constructor.

virtual Engine::~Engine ( )
virtualdefault

Engine destructor.

Member Function Documentation

void Engine::activateScene ( const std::string &  name)

Activates a scene by name.

Parameters
[in]nameThe name

References findSceneByName().

Referenced by generated::getEngineModule().

void Engine::addScene ( std::shared_ptr< Game::Scene scene)
noexcept

Adds a scene to the engine.

Parameters
[in]sceneThe scene

Referenced by generated::getEngineModule().

void Engine::cleanUp ( )

Cleans up before exiting.

void Engine::deactivateScene ( const std::string &  name)

Deactivates a scene by name.

Parameters
[in]nameThe name

References findSceneByName().

Referenced by generated::getEngineModule().

std::shared_ptr< Game::Scene > Engine::findSceneByName ( const std::string &  name)
noexcept

Finds a scene by name.

Parameters
[in]nameThe name
Returns
The scene, nullptr if it doesn't exist

Referenced by activateScene(), deactivateScene(), and generated::getEngineModule().

std::vector< std::string > Engine::getActiveSceneNames ( ) const
noexcept

Gets the active scene names.

Returns
The active scene names.

Referenced by generated::getEngineModule().

std::vector< std::string > Engine::getSceneNames ( ) const
noexcept

Gets the scene names.

Returns
The scene names.

Referenced by generated::getEngineModule().

std::map< std::shared_ptr< Game::Scene >, bool > Engine::getScenes ( ) const
noexcept

Gets the scenes.

Returns
The scenes.

Referenced by generated::getEngineModule().

void Engine::mainLoop ( )

Triggers the main loop for the engine.

void Engine::timeToExit ( )
noexcept

This is to signal the engine that it is time to shut down.

Referenced by generated::getEngineModule().


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