supertux
|
The SquirrelEnvironment contains the environment in which a script is executed, meaning a root table containing objects and variables. More...
#include <squirrel_environment.hpp>
Public Member Functions | |
SquirrelEnvironment (ssq::VM &vm, const std::string &name) | |
ssq::VM & | get_vm () const |
void | expose_self () |
Expose this engine under 'name'. | |
void | unexpose_self () |
void | expose (ExposableClass &object, const std::string &name) |
Expose and unexpose objects. | |
void | unexpose (const std::string &name) |
void | run_script (const std::string &script, const std::string &sourcename) |
Convenience function that takes an std::string instead of an std::istream&. | |
void | run_script (std::istream &in, const std::string &sourcename) |
Runs a script in the context of the SquirrelEnvironment (m_table will be the roottable of this squirrel VM) and keeps a reference to the script so the script gets destroyed when the SquirrelEnvironment is destroyed). More... | |
void | update (float dt_sec) |
SQInteger | wait_for_seconds (HSQUIRRELVM vm, float seconds) |
SQInteger | skippable_wait_for_seconds (HSQUIRRELVM vm, float seconds) |
The SquirrelEnvironment contains the environment in which a script is executed, meaning a root table containing objects and variables.
void SquirrelEnvironment::run_script | ( | std::istream & | in, |
const std::string & | sourcename | ||
) |
Runs a script in the context of the SquirrelEnvironment (m_table will be the roottable of this squirrel VM) and keeps a reference to the script so the script gets destroyed when the SquirrelEnvironment is destroyed).