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

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...
 

Detailed Description

Class for scripting system.

Constructor & Destructor Documentation

Script::ScriptingSystem::ScriptingSystem ( )
delete
Script::ScriptingSystem::ScriptingSystem ( const std::string  scripts_location)

ScriptingSystem constructor, this registers all modules.

Parameters
[in]scripts_locationThe scripts location

References Script::ChaiscriptWrapper::getInstance().

Member Function Documentation

template<class T >
void Script::ScriptingSystem::addGlobalObject ( std::shared_ptr< T >  object,
const std::string &  name 
)
inline

Adds a global object of type to chaiscript.

Parameters
[in]objectThe object
[in]nameThe name
Template Parameters
TType of the object to add

References Script::ChaiscriptWrapper::getInstance().

template<class T >
void Script::ScriptingSystem::addObject ( std::shared_ptr< T >  object,
const std::string &  name 
)
inline

Adds an object of type to chaiscript.

Parameters
[in]objectThe object
[in]nameThe name
Template Parameters
TType 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.

Parameters
[in]nameThe 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.

Parameters
[in]moduleThe 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.

Parameters
[in]deltaThe delta

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