18 #ifndef HEADER_SUPERTUX_SQUIRREL_SQUIRREL_ENVIRONMENT_HPP 19 #define HEADER_SUPERTUX_SQUIRREL_SQUIRREL_ENVIRONMENT_HPP 24 #include <simplesquirrel/vm.hpp> 26 #include "squirrel/exposable_class.hpp" 27 #include "squirrel/squirrel_scheduler.hpp" 28 #include "squirrel/squirrel_util.hpp" 29 #include "util/log.hpp" 41 ssq::VM& get_vm()
const {
return m_vm; }
49 void unexpose(
const std::string& name);
53 void run_script(
const std::string& script,
const std::string& sourcename);
59 void run_script(std::istream& in,
const std::string& sourcename);
61 void update(
float dt_sec);
62 SQInteger wait_for_seconds(HSQUIRRELVM vm,
float seconds);
63 SQInteger skippable_wait_for_seconds(HSQUIRRELVM vm,
float seconds);
66 void garbage_collect();
72 std::vector<ssq::VM> m_scripts;
73 std::unique_ptr<SquirrelScheduler> m_scheduler;
void expose_self()
Expose this engine under 'name'.
Definition: squirrel_environment.cpp:53
The SquirrelEnvironment contains the environment in which a script is executed, meaning a root table ...
Definition: squirrel_environment.hpp:34
void expose(ExposableClass &object, const std::string &name)
Expose and unexpose objects.
Definition: squirrel_environment.cpp:65
Represents a class, which can be exposed to scripting.
Definition: exposable_class.hpp:25
void run_script(const std::string &script, const std::string &sourcename)
Convenience function that takes an std::string instead of an std::istream&.
Definition: squirrel_environment.cpp:99