src/supertux/world.hpp

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 #ifndef HEADER_SUPERTUX_SUPERTUX_WORLD_HPP
00018 #define HEADER_SUPERTUX_SUPERTUX_WORLD_HPP
00019 
00020 #include <squirrel.h>
00021 #include <string>
00022 #include <vector>
00023 
00024 class PlayerStatus;
00025 
00026 class World
00027 {
00028 public:
00029   static World* current()
00030   {
00031     return current_;
00032   }
00033 
00034 private:
00035   static World* current_;
00036 
00037 public:
00038   World();
00039   ~World();
00040 
00041   void set_savegame_filename(const std::string& filename);
00042   void load(const std::string& filename);
00043 
00044   void save_state();
00045   void load_state();
00046 
00047   unsigned int get_num_levels() const;
00048 
00049   const std::string& get_level_filename(unsigned int i) const;
00050   const std::string& get_basedir() const;
00051   const std::string& get_title() const;
00053   PlayerStatus* get_player_status() const { return player_status.get(); }
00054 
00055 
00056   void run();
00057 
00058 private:
00059   std::vector<std::string> levels;
00060   std::string basedir;
00061   std::string savegame_filename;
00063   HSQOBJECT state_table;
00064   HSQOBJECT world_thread;
00065   std::string title;
00066   std::string description;
00067   std::auto_ptr<PlayerStatus> player_status;
00068 
00069 public:
00070   bool hide_from_contribs;
00071   bool is_levelset;
00072 };
00073 
00074 #endif
00075 
00076 /* EOF */

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