Class ScriptSystem
Defined in File ScriptSystem.h
Class Documentation
-
class ScriptSystem
A JavaScript based scripting system that can be used to create advanced behaviours and interactions between entities in spaces.
Public Functions
-
void Initialise()
Starts up the JavaScript runtime context.
-
void Shutdown()
Shuts down and deletes the JavaScript runtime context.
-
bool RunScript(int64_t ContextId, const csp::common::String &ScriptText)
Attempts to execute a script in a given context.
- Parameters
ContextId – : The context in which to run the script. If the provided context does not exist, the script run will fail.
ScriptText – : The script to execute.
- Returns
a boolean representing success running the script.
-
bool RunScriptFile(int64_t ContextId, const csp::common::String &ScriptFilePath)
Attempts to execute a script from a given file path in the given context.
- Parameters
ContextId – : The context in which to run the script. If the provided context does not exist, the script run will fail.
ScriptFilePath – : The file path of the script to execute.
- Returns
a boolean representing success running the script.
-
bool CreateContext(int64_t ContextId)
-
bool DestroyContext(int64_t ContextId)
-
bool BindContext(int64_t ContextId)
-
bool ResetContext(int64_t ContextId)
-
void *GetContext(int64_t ContextId)
-
void RegisterScriptBinding(IScriptBinding *ScriptBinding)
-
void UnregisterScriptBinding(IScriptBinding *ScriptBinding)
-
void AddModuleUrlAlias(const csp::common::String &ModuleUrl, const csp::common::String &ModuleUrlAlias)
-
bool GetModuleUrlAlias(const csp::common::String &ModuleUrl, csp::common::String &OutModuleUrlAlias)
-
size_t GetNumImportedModules(int64_t ContextId) const
-
const char *GetImportedModule(int64_t ContextId, size_t Index) const
-
void Initialise()