|
void | Init () override |
|
void | Register (Sqrat::Object * object) override |
|
void | Remove (Sqrat::Object * object) override |
|
Sqrat::Object * | Get (int index) const override |
|
std::list< Sqrat::Object * > | GetAll () const override |
|
int | GetID (Sqrat::Object * object) const override |
|
int | GetSize () const override |
|
virtual void | Register (T object)=0 |
|
virtual void | Remove (T object)=0 |
|
virtual T | Get (M index) const =0 |
|
virtual M | GetID (T object) const =0 |
|
virtual void | Update (float elapsedTime) |
|
Definition at line 9 of file ScriptMgr.h.
◆ ~ScriptMgr()
ScriptMgr::~ScriptMgr |
( |
| ) |
|
|
override |
Definition at line 54 of file ScriptMgr.cpp.
54 {
55 ReleaseSqratObject();
56 sq_close(DefaultVM::Get());
57}
◆ Init()
Implements CSE::CoreBase.
Definition at line 60 of file ScriptMgr.cpp.
60 {
61 HSQUIRRELVM vm;
62
63 vm = sq_open(1024);
64 Sqrat::DefaultVM::Set(vm);
65
66 sq_pushroottable(vm);
67 sqstd_register_mathlib(vm);
68 sq_pop(vm, 1);
69
70 DefineClasses();
71 ReadScriptList();
72}
◆ RegisterScript()
void ScriptMgr::RegisterScript |
( |
const std::string & |
script | ) |
|
|
static |
Definition at line 75 of file ScriptMgr.cpp.
75 {
76
77 HSQUIRRELVM vm = DefaultVM::Get();
78
79
80 if (!script.empty()) {
81 Script compiledScript;
82 compiledScript.CompileString(script);
83 if (Sqrat::Error::Occurred(vm)) {
84 SafeLog::Log((_SC("Compile Failed: ") + Error::Message(vm)).c_str());
85 }
86
87 compiledScript.Run();
88 if (Sqrat::Error::Occurred(vm)) {
89 SafeLog::Log((_SC("Run Failed: ") + Error::Message(vm)).c_str());
90 }
91
92 compiledScript.Release();
93 }
94
95}
The documentation for this class was generated from the following files: