Nymph Game Engine
Chaiscript based Game Engine
|
Class for scripting system. More...
#include <scripting_system.h>
Public Member Functions | |
ScriptingSystem ()=delete | |
ScriptingSystem (const std::string scripts_location) | |
ScriptingSystem constructor, this registers all modules. More... | |
void | registerModule (chaiscript::ModulePtr module) |
Registers a chaiscript module. More... | |
void | loadScript (const std::string &name) |
Loads a script. More... | |
void | loadScripts () |
Loads all scripts in scripts location, recursively. More... | |
template<class T > | |
void | addObject (std::shared_ptr< T > object, const std::string &name) |
Adds an object of type to chaiscript. More... | |
template<class T > | |
void | addGlobalObject (std::shared_ptr< T > object, const std::string &name) |
Adds a global object of type to chaiscript. More... | |
void | save (const std::string &file) |
void | load (const std::string &file) |
void | start () |
Calls onStart in all scripts. More... | |
void | update (const float delta) |
Calls onUpdate in all scripts. More... | |
void | destroy () |
Calls onDestroy in all scripts. More... | |
Class for scripting system.
|
delete |
Script::ScriptingSystem::ScriptingSystem | ( | const std::string | scripts_location | ) |
ScriptingSystem constructor, this registers all modules.
[in] | scripts_location | The scripts location |
References Script::ChaiscriptWrapper::getInstance().
|
inline |
Adds a global object of type to chaiscript.
[in] | object | The object |
[in] | name | The name |
T | Type of the object to add |
References Script::ChaiscriptWrapper::getInstance().
|
inline |
Adds an object of type to chaiscript.
[in] | object | The object |
[in] | name | The name |
T | Type of the object to add |
References Script::ChaiscriptWrapper::getInstance().
void Script::ScriptingSystem::destroy | ( | ) |
Calls onDestroy in all scripts.
References Script::ChaiscriptWrapper::destroyInstance().
void Script::ScriptingSystem::load | ( | const std::string & | file | ) |
void Script::ScriptingSystem::loadScript | ( | const std::string & | name | ) |
Loads a script.
[in] | name | The name |
References Script::ChaiscriptWrapper::getInstance().
Referenced by loadScripts().
void Script::ScriptingSystem::loadScripts | ( | ) |
Loads all scripts in scripts location, recursively.
References loadScript().
void Script::ScriptingSystem::registerModule | ( | chaiscript::ModulePtr | module | ) |
Registers a chaiscript module.
[in] | module | The module |
References Script::ChaiscriptWrapper::getInstance().
void Script::ScriptingSystem::save | ( | const std::string & | file | ) |
void Script::ScriptingSystem::start | ( | ) |
Calls onStart in all scripts.
References Script::ChaiscriptWrapper::getInstance().
void Script::ScriptingSystem::update | ( | const float | delta | ) |
Calls onUpdate in all scripts.
[in] | delta | The delta |