X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Flevel.h;h=cc280b5e31c022aae7318750cdd0c887a63e3346;hb=8385faa306eca6d96ab11ed7dae293d85e9c4e4f;hp=e9bb6f0d34d5779b29034932f97fbbd8cb16095a;hpb=c79b901309bf5e0544fef1e92d264f51402f4370;p=supertux.git diff --git a/src/level.h b/src/level.h index e9bb6f0d3..cc280b5e3 100644 --- a/src/level.h +++ b/src/level.h @@ -24,46 +24,28 @@ #include #include -#include "screen/surface.h" -#include "lispreader.h" -#include "musicref.h" - -class Tile; - -/** This type holds meta-information about a level-subset. - It could be extended to handle manipulation of subsets. */ -class LevelSubset -{ -public: - LevelSubset(); - ~LevelSubset(); - - static void create(const std::string& subset_name); - void load(const char* subset); - void save(); - - std::string get_level_filename(unsigned int i); - - std::string name; - std::string title; - std::string description; - Surface* image; - int levels; - -private: - void parse(lisp_object_t* cursor); -}; +using namespace SuperTux; class Sector; +namespace SuperTux { +class LispReader; +} + class Level { public: + enum EndSequenceType{ + NONE_ENDSEQ_ANIM, + FIREWORKS_ENDSEQ_ANIM + }; + std::string name; std::string author; - int time_left; + int timelimit; typedef std::map Sectors; Sectors sectors; + EndSequenceType end_sequence_type; public: Level(); @@ -71,6 +53,10 @@ public: void load(const std::string& filename); void save(const std::string& filename); + static void create(const std::string& filename); + + EndSequenceType get_end_sequence_type() const + { return end_sequence_type; } const std::string& get_name() const { return name; } @@ -78,10 +64,21 @@ public: const std::string& get_author() const { return author; } + /** Flips the level vertically */ + void do_vertical_flip(); + void add_sector(Sector* sector); Sector* get_sector(const std::string& name); + Sector* get_next_sector(const Sector* sector); + Sector* get_previous_sector(const Sector* sector); + + int get_total_sectors(); + + int get_total_badguys(); + int get_total_coins(); + private: void load_old_format(LispReader& reader); };