#include <squirrel.h>
#include <iostream>
#include "timer.h"
+#include "game_object.h"
+#include "scripting/sound.h"
+#include "scripting/level.h"
-class ScriptInterpreter
+class Sector;
+
+class ScriptInterpreter : public GameObject
{
public:
- ScriptInterpreter();
+ ScriptInterpreter(Sector* sector);
~ScriptInterpreter();
+ void draw(DrawingContext& );
+ void action(float );
+
void load_script(std::istream& in, const std::string& sourcename = "");
- void run_script();
+ void start_script();
void expose_object(void* object, const std::string& name,
const std::string& type);
- void suspend(float seconds);
- void update();
+ void set_wakeup_time(float seconds);
static ScriptInterpreter* current()
{
private:
HSQUIRRELVM v;
static ScriptInterpreter* _current;
- Timer resume_timer;
+ Timer wakeup_timer;
+
+ Scripting::Sound* sound;
+ Scripting::Level* level;
};
#endif