src/scripting/level.cpp

Go to the documentation of this file.
00001 //  SuperTux
00002 //  Copyright (C) 2006 Matthias Braun <matze@braunis.de>
00003 //
00004 //  This program is free software: you can redistribute it and/or modify
00005 //  it under the terms of the GNU General Public License as published by
00006 //  the Free Software Foundation, either version 3 of the License, or
00007 //  (at your option) any later version.
00008 //
00009 //  This program is distributed in the hope that it will be useful,
00010 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012 //  GNU General Public License for more details.
00013 //
00014 //  You should have received a copy of the GNU General Public License
00015 //  along with this program.  If not, see <http://www.gnu.org/licenses/>.
00016 
00017 #include "supertux/flip_level_transformer.hpp"
00018 #include "supertux/game_session.hpp"
00019 
00020 namespace scripting {
00021 void
00022 Level_finish(bool win)
00023 {
00024   if(GameSession::current() == NULL)
00025     return;
00026 
00027   GameSession::current()->finish(win);
00028 }
00029 
00030 void
00031 Level_spawn(const std::string& sector, const std::string& spawnpoint)
00032 {
00033   if(GameSession::current() == NULL)
00034     return;
00035 
00036   GameSession::current()->respawn(sector, spawnpoint);
00037 }
00038 
00039 void
00040 Level_flip_vertically()
00041 {
00042   FlipLevelTransformer flip_transformer;
00043   flip_transformer.transform(GameSession::current()->get_current_level());
00044 }
00045 
00046 void
00047 Level_toggle_pause()
00048 {
00049   if(GameSession::current() == NULL)
00050     return;
00051   GameSession::current()->toggle_pause();
00052 }
00053 
00054 void
00055 Level_edit(bool edit_mode)
00056 {
00057   if(GameSession::current() == NULL) return;
00058   GameSession::current()->set_editmode(edit_mode);
00059 }
00060 
00061 }
00062 
00063 /* EOF */

Generated on Mon Jun 9 03:38:21 2014 for SuperTux by  doxygen 1.5.1