1 #ifndef SCRIPTING_SYSTEM_H
2 #define SCRIPTING_SYSTEM_H
12 std::string scripts_location;
13 std::vector<std::string> getFileList(
const std::string& location);
15 std::vector<std::shared_ptr<ScriptObject>> scripts;
17 std::string filenameToTitleCase(std::string s);
52 void addObject(std::shared_ptr<T>
object,
const std::string& name) {
69 void save(
const std::string& file);
71 void load(
const std::string& file);
82 void update(
const float delta);
void addObject(std::shared_ptr< T > object, const std::string &name)
Adds an object of type to chaiscript.
Definition: scripting_system.h:52
void save(const std::string &file)
Definition: scripting_system.cpp:106
Class for scripting system.
Definition: scripting_system.h:10
void loadScripts()
Loads all scripts in scripts location, recursively.
Definition: scripting_system.cpp:90
void update(const float delta)
Calls onUpdate in all scripts.
Definition: scripting_system.cpp:162
static std::shared_ptr< chaiscript::ChaiScript > getInstance()
Definition: chaiscript_wrapper.cpp:22
void registerModule(chaiscript::ModulePtr module)
Registers a chaiscript module.
Definition: scripting_system.cpp:41
void addGlobalObject(std::shared_ptr< T > object, const std::string &name)
Adds a global object of type to chaiscript.
Definition: scripting_system.h:65
void start()
Calls onStart in all scripts.
Definition: scripting_system.cpp:141
void destroy()
Calls onDestroy in all scripts.
Definition: scripting_system.cpp:175
void load(const std::string &file)
Definition: scripting_system.cpp:121
void loadScript(const std::string &name)
Loads a script.
Definition: scripting_system.cpp:45