1 #ifndef __SCRIPT_INTERPRETER_H__
2 #define __SCRIPT_INTERPRETER_H__
7 #include "game_object.hpp"
8 #include "scripting/sound.hpp"
9 #include "scripting/level.hpp"
13 class ScriptInterpreter : public GameObject
16 ScriptInterpreter(const std::string& working_dir);
19 void register_sector(Sector* sector);
21 void draw(DrawingContext& );
24 void run_script(std::istream& in, const std::string& sourcename = "",
25 bool remove_when_terminated = true);
27 void expose_object(void* object, const std::string& name,
28 const std::string& type);
30 void set_wakeup_time(float seconds);
32 /** helper function that parses a script, starts it and adds it to the sector
35 static void add_script_object(Sector* sector, const std::string& scriptname,
36 const std::string& script);
38 static ScriptInterpreter* current()
43 const std::string& get_working_directory() const
45 return working_directory;
50 static ScriptInterpreter* _current;
53 /// this directory is used as base for all filenames used in scripts
54 std::string working_directory;
55 Scripting::Sound* sound;
56 Scripting::Level* level;