Merge branch 'master' of https://code.google.com/p/supertux
[supertux.git] / src / worldmap / worldmap.hpp
index ba2eed6..b0e56ac 100644 (file)
 #include "worldmap/sprite_change.hpp"
 #include "worldmap/teleporter.hpp"
 
-class Sprite;
 class GameObject;
-class TileMap;
 class PlayerStatus;
+class Sprite;
+class TileMap;
+class Savegame;
 
 namespace worldmap {
 
@@ -77,7 +78,7 @@ private:
 
   Tux* tux;
 
-  PlayerStatus* player_status;
+  Savegame& m_savegame;
 
   TileSet *tileset;
   bool     free_tileset;
@@ -123,11 +124,11 @@ private:
   bool panning;
 
 public:
-  WorldMap(const std::string& filename, PlayerStatus* player_status, const std::string& force_spawnpoint = "");
+  WorldMap(const std::string& filename, Savegame& savegame, const std::string& force_spawnpoint = "");
   ~WorldMap();
 
   void add_object(GameObject* object);
-  
+
   void try_expose(GameObject* object);
   void try_unexpose(GameObject* object);
 
@@ -145,13 +146,13 @@ public:
   Vector get_next_tile(Vector pos, Direction direction);
 
   /**
-   * gets a bitfield of Tile::WORLDMAP_NORTH | Tile::WORLDMAP_WEST | ... values, 
+   * gets a bitfield of Tile::WORLDMAP_NORTH | Tile::WORLDMAP_WEST | ... values,
    * which indicates the directions Tux can move to when at the given position.
    */
   int available_directions_at(Vector pos);
 
   /**
-   * returns a bitfield representing the union of all Tile::WORLDMAP_XXX values 
+   * returns a bitfield representing the union of all Tile::WORLDMAP_XXX values
    * of all solid tiles at the given position
    */
   int tile_data_at(Vector pos);
@@ -168,8 +169,7 @@ public:
   /** returns current Tux incarnation */
   Tux* get_tux() { return tux; }
 
-  /** returns player status */
-  PlayerStatus* get_player_status() { return player_status; }
+  Savegame& get_savegame() { return m_savegame; }
 
   LevelTile* at_level();
   SpecialTile* at_special_tile();
@@ -220,6 +220,11 @@ public:
    */
   float get_height() const;
 
+  /**
+   * Mark all levels as solved or unsolved
+   */
+  void set_levels_solved(bool solved, bool perfect);
+
 private:
   void get_level_title(LevelTile& level);
   void get_level_target_time(LevelTile& level);