class ScriptInterpreter : public GameObject
{
public:
- ScriptInterpreter(Sector* sector);
+ ScriptInterpreter(const std::string& working_dir);
~ScriptInterpreter();
+ void register_sector(Sector* sector);
+
void draw(DrawingContext& );
- void action(float );
+ void update(float );
void load_script(std::istream& in, const std::string& sourcename = "");
void start_script();
return _current;
}
+ const std::string& get_working_directory() const
+ {
+ return working_directory;
+ }
+
private:
HSQUIRRELVM v;
static ScriptInterpreter* _current;
Timer wakeup_timer;
+ /// this directory is used as base for all filenames used in scripts
+ std::string working_directory;
Scripting::Sound* sound;
Scripting::Level* level;
};