19#ifndef HEADER_SCRIPT_ENGINE_HPP
20#define HEADER_SCRIPT_ENGINE_HPP
22#include "scriptengine/script_utils.hpp"
23#include "utils/no_copy.hpp"
24#include "utils/ptr_vector.hpp"
27#include <angelscript.h>
45 asIScriptFunction* m_callback_delegate;
49 m_callback_delegate = NULL;
70 void runFunction(
bool warn_if_not_found, std::string function_name);
71 void runFunction(
bool warn_if_not_found, std::string function_name,
72 std::function<
void(asIScriptContext*)> callback);
73 void runFunction(
bool warn_if_not_found, std::string function_name,
74 std::function<
void(asIScriptContext*)> callback,
75 std::function<
void(asIScriptContext*)> get_return_value);
76 void runDelegate(asIScriptFunction* delegate_fn);
77 void evalScript(std::string script_fragment);
80 bool loadScript(std::string script_path,
bool clear_previous);
81 bool compileLoadedScripts();
83 void addPendingTimeout(
double time,
const std::string& callback_name);
84 void addPendingTimeout(
double time, asIScriptFunction* delegate_fn);
85 void update(
float dt);
87 asIScriptEngine* getEngine() {
return m_engine; }
90 asIScriptEngine *m_engine;
91 std::map<std::string, asIScriptFunction*> m_functions_cache;
Manages the abstract singleton at runtime. This has been designed to allow multi-inheritance....
Definition: singleton.hpp:35
Utility class, you can inherit from this class to disallow the assignment operator and copy construct...
Definition: no_copy.hpp:26
Definition: ptr_vector.hpp:44
Definition: script_engine.hpp:60
void runFunction(bool warn_if_not_found, std::string function_name)
runs the specified script
Definition: script_engine.cpp:328
void configureEngine(asIScriptEngine *engine)
Configures the script engine by binding functions, enums.
Definition: script_engine.cpp:496
Base class for all track object presentation classes.
Definition: track_object_presentation.hpp:57
Represents a scripting function to execute after a given time.
Definition: script_engine.hpp:38
std::string m_callback_name
We have two callback types: a string containing the name of the function to call (simple callback) or...
Definition: script_engine.hpp:44