- Change ScriptInterpreter to a gameobject, so we can now have several script
[supertux.git] / src / scripting / script_interpreter.h
index ff3d77e..73f596b 100644 (file)
@@ -4,21 +4,28 @@
 #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()
   {
@@ -28,7 +35,10 @@ public:
 private:
   HSQUIRRELVM v;
   static ScriptInterpreter* _current;
-  Timer resume_timer;
+  Timer wakeup_timer;
+
+  Scripting::Sound* sound;
+  Scripting::Level* level;
 };
 
 #endif