X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Flevel.hpp;h=eb3ba5ce3db30a73d3ee25e7a9bd5e2b78dd472b;hb=45635d47cba9d7d4359a717b810c5d4e6b4a2848;hp=2175b3cd96e1b51ed6a25a954976fb483043724c;hpb=d54bc022663f96293582cfd13b3bb19b7b91b048;p=supertux.git diff --git a/src/level.hpp b/src/level.hpp index 2175b3cd9..eb3ba5ce3 100644 --- a/src/level.hpp +++ b/src/level.hpp @@ -1,7 +1,7 @@ // $Id$ -// +// // SuperTux -// Copyright (C) 2004 SuperTux Development Team, see AUTHORS for details +// Copyright (C) 2006 Matthias Braun // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License @@ -12,7 +12,7 @@ // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -// +// // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA @@ -23,22 +23,29 @@ #include #include - -class Sector; +#include "statistics.hpp" +#include "sector.hpp" namespace lisp { class Lisp; } +/** + * Represents a collection of Sectors running in a single GameSession. + * + * Each Sector in turn contains GameObjects, e.g. Badguys and Players. + */ class Level { public: std::string name; std::string author; - std::string extro_music; - float extro_length; + std::string contact; + std::string license; + std::string on_menukey_script; typedef std::vector Sectors; Sectors sectors; + Statistics stats; public: Level(); @@ -61,8 +68,18 @@ public: size_t get_sector_count(); Sector* get_sector(size_t num); - int get_total_badguys(); int get_total_coins(); + int get_total_badguys(); + + /** Get total number of GameObjects of given type */ + template int get_total_count() + { + int total = 0; + for(Sectors::iterator i = sectors.begin(); i != sectors.end(); ++i) { + total += (*i)->get_total_count(); + } + return total; + } private: void load_old_format(const lisp::Lisp& reader);