-typedef struct st_level /*It is easier to read the sources IMHO, if we don't write something like int a,b,c; */
- {
- char name[LEVEL_NAME_MAX];
- char theme[100];
- char song_title[100];
- char bkgd_image[100];
- unsigned char* tiles[15];
- int time_left;
- int bkgd_red;
- int bkgd_green;
- int bkgd_blue;
- int width;
- float gravity;
- } st_level;
+
+enum TileMapType {
+ TM_BG,
+ TM_IA,
+ TM_FG
+ };
+
+struct ResetPoint
+{
+ int x;
+ int y;
+};
+
+class Level
+{
+ public:
+ Surface* img_bkgd;
+ MusicRef level_song;
+ MusicRef level_song_fast;
+
+ std::string name;
+ std::string author;
+ std::string theme;
+ std::string song_title;
+ std::string bkgd_image;
+ std::string particle_system;
+ std::vector<unsigned int> bg_tiles[15]; /* Tiles in the background */
+ std::vector<unsigned int> ia_tiles[15]; /* Tiles which can interact in the game (solids for example)*/
+ std::vector<unsigned int> fg_tiles[15]; /* Tiles in the foreground */
+ int time_left;
+ Color bkgd_top;
+ Color bkgd_bottom;
+ int width;
+ int start_pos_x;
+ int start_pos_y;
+ float gravity;
+
+ std::vector<BadGuyData> badguy_data;
+
+ /** A collection of points to which Tux can be reset after a lost live */
+ std::vector<ResetPoint> reset_points;
+ public:
+ Level();
+ Level(const std::string& subset, int level);
+ Level(const std::string& filename);
+ ~Level();
+
+ /** Will the Level structure with default values */
+ void init_defaults();