X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Flevel.hpp;h=1ab7448903a0c878bc53c88b628d781218ceedc2;hb=3da5eb5cc8f63053aaebb48cb2fffbed66f30d47;hp=f91ab3c232ae5ac7bbd99511ae6be1dae6d33c72;hpb=52de79ad8301a395a5a2999ecbdf31731c0b65f8;p=supertux.git diff --git a/src/level.hpp b/src/level.hpp index f91ab3c23..1ab744890 100644 --- a/src/level.hpp +++ b/src/level.hpp @@ -24,8 +24,7 @@ #include #include #include "statistics.hpp" - -class Sector; +#include "sector.hpp" namespace lisp { class Lisp; @@ -36,6 +35,7 @@ class Level public: std::string name; std::string author; + std::string on_menukey_script; typedef std::vector Sectors; Sectors sectors; Statistics stats; @@ -61,8 +61,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);