* Small miniswig update to use less dependencies
[supertux.git] / src / scripting / level.cpp
index 25e0fa9..48b8d3d 100644 (file)
 
 namespace Scripting
 {
-  Level::Level()
-  {}
-
-  Level::~Level()
-  {}
-
   void
-  Level::finish(bool win)
+  Level_finish(bool win)
   {
+    if(GameSession::current() == NULL)
+      return;
+
     GameSession::current()->finish(win);
   }
 
   void
-  Level::spawn(const std::string& sector, const std::string& spawnpoint)
+  Level_spawn(const std::string& sector, const std::string& spawnpoint)
   {
+    if(GameSession::current() == NULL)
+      return;
+
     GameSession::current()->respawn(sector, spawnpoint);
   }
 
   void
-  Level::flip_vertically()
+  Level_flip_vertically()
   {
     FlipLevelTransformer flip_transformer;
     flip_transformer.transform(GameSession::current()->get_current_level());
   }
+
+  void
+  Level_toggle_pause()
+  {
+    if(GameSession::current() == NULL)
+      return;
+    GameSession::current()->toggle_pause();
+  }
+
+  void
+  Level_edit(bool edit_mode)
+  {
+    if(GameSession::current() == NULL) return;
+    GameSession::current()->set_editmode(edit_mode);
+  }
+
 }