SuperTuxKart
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
Scripting::ScriptEngine Class Reference
Inheritance diagram for Scripting::ScriptEngine:
Inheritance graph
[legend]

Public Member Functions

void runFunction (bool warn_if_not_found, std::string function_name)
 runs the specified script
 
void runFunction (bool warn_if_not_found, std::string function_name, std::function< void(asIScriptContext *)> callback)
 
void runFunction (bool warn_if_not_found, std::string function_name, std::function< void(asIScriptContext *)> callback, std::function< void(asIScriptContext *)> get_return_value)
 runs the specified script
 
void runDelegate (asIScriptFunction *delegate_fn)
 
void evalScript (std::string script_fragment)
 
void cleanupCache ()
 
bool loadScript (std::string script_path, bool clear_previous)
 
bool compileLoadedScripts ()
 
void addPendingTimeout (double time, const std::string &callback_name)
 
void addPendingTimeout (double time, asIScriptFunction *delegate_fn)
 
void update (float dt)
 
asIScriptEngine * getEngine ()
 

Private Member Functions

void configureEngine (asIScriptEngine *engine)
 Configures the script engine by binding functions, enums.
 

Private Attributes

asIScriptEngine * m_engine
 
std::map< std::string, asIScriptFunction * > m_functions_cache
 
PtrVector< PendingTimeoutm_pending_timeouts
 

Friends

class AbstractSingleton< ScriptEngine >
 

Additional Inherited Members

- Static Public Member Functions inherited from AbstractSingleton< ScriptEngine >
static S * getInstance ()
 Used to get the instance, after a dynamic cast. This is important when making a double-inheritance of this class. For example, if A is a singleton inherited by B, you can call B::getInstance<A>() to have the instance returned as a A*. If the cast fails, a log message will notify it.
 
static ScriptEngine * getInstance ()
 Used to get the instance.
 
static void kill ()
 Used to kill the singleton, if needed.
 
- Protected Member Functions inherited from AbstractSingleton< ScriptEngine >
 AbstractSingleton ()
 Constructor.
 
virtual ~AbstractSingleton ()
 Destructor.
 

Member Function Documentation

◆ configureEngine()

void Scripting::ScriptEngine::configureEngine ( asIScriptEngine *  engine)
private

Configures the script engine by binding functions, enums.

Parameters
asIScriptEngineengine = engine to configure

◆ runFunction() [1/2]

void Scripting::ScriptEngine::runFunction ( bool  warn_if_not_found,
std::string  function_name 
)

runs the specified script

Parameters
stringscriptName = name of script to run

◆ runFunction() [2/2]

void Scripting::ScriptEngine::runFunction ( bool  warn_if_not_found,
std::string  function_name,
std::function< void(asIScriptContext *)>  callback,
std::function< void(asIScriptContext *)>  get_return_value 
)

runs the specified script

Parameters
stringscriptName = name of script to run

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