src/supertux/level.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_LEVEL_HPP
00018 #define HEADER_SUPERTUX_SUPERTUX_LEVEL_HPP
00019 
00020 #include "supertux/statistics.hpp"
00021 #include "util/reader_fwd.hpp"
00022 
00023 class TileSet;
00024 class Sector;
00025 
00031 class Level
00032 {
00033 public:
00034   typedef std::vector<Sector*> Sectors;
00035 
00036   std::string name;
00037   std::string author;
00038   std::string contact;
00039   std::string license;
00040   std::string filename;
00041   std::string on_menukey_script;
00042   Sectors     sectors;
00043   Statistics  stats;
00044   TileSet    *tileset;
00045   bool        free_tileset;
00046 
00047 public:
00048   Level();
00049   ~Level();
00050 
00051   // loads a levelfile
00052   void load(const std::string& filename);
00053 
00054   const std::string& get_name() const
00055   { return name; }
00056 
00057   const std::string& get_author() const
00058   { return author; }
00059 
00060   void add_sector(Sector* sector);
00061 
00062   Sector* get_sector(const std::string& name);
00063 
00064   size_t get_sector_count();
00065   Sector* get_sector(size_t num);
00066 
00067   const TileSet *get_tileset() const
00068   { return tileset; }
00069 
00070   int get_total_coins();
00071   int get_total_badguys();
00072   int get_total_secrets();
00073 
00074 private:
00075   void load_old_format(const Reader& reader);
00076 
00077 private:
00078   Level(const Level&);
00079   Level& operator=(const Level&);
00080 };
00081 
00082 #endif /*SUPERTUX_LEVEL_H*/
00083 
00084 /* EOF */

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