19 #ifndef HEADER_SUPERTUX_WORLDMAP_WORLDMAP_HPP 20 #define HEADER_SUPERTUX_WORLDMAP_WORLDMAP_HPP 22 #include "util/currenton.hpp" 24 #include "control/controller.hpp" 25 #include "supertux/savegame.hpp" 26 #include "supertux/timer.hpp" 27 #include "worldmap/worldmap_sector.hpp" 39 static Color s_level_title_color;
40 static Color s_message_color;
41 static Color s_teleporter_message_color;
45 const std::string& force_sector =
"",
const std::string& force_spawnpoint =
"");
51 void update(
float dt_sec);
52 void process_input(
const Controller& controller);
54 size_t level_count()
const;
55 size_t solved_level_count()
const;
65 void change(
const std::string& filename,
const std::string& force_sector =
"",
66 const std::string& force_spawnpoint =
"");
77 const std::string& get_title()
const {
return m_name; }
78 Savegame& get_savegame()
const {
return m_savegame; }
79 const std::string& get_levels_path()
const {
return m_levels_path; }
84 void add_sector(std::unique_ptr<WorldMapSector> sector);
86 void set_sector(
const std::string& name,
const std::string& spawnpoint =
"",
87 bool perform_full_setup =
true);
89 const std::string& get_filename()
const;
92 void on_escape_press();
96 std::vector<std::unique_ptr<WorldMapSector> > m_sectors;
98 std::string m_force_spawnpoint;
104 std::string m_map_filename;
105 std::string m_levels_path;
108 std::unique_ptr<WorldMap> m_next_worldmap;
111 std::string m_passive_message;
112 Timer m_passive_message_timer;
116 bool m_in_world_select;
void set_initial_spawnpoint(const std::string &spawnpoint)
Sets the initial spawnpoint to be forced on next setup.
Definition: worldmap.cpp:273
Definition: controller.hpp:57
Definition: worldmap_state.hpp:30
WorldMap(const std::string &filename, Savegame &savegame, const std::string &force_sector="", const std::string &force_spawnpoint="")
Definition: worldmap.cpp:49
Represents one of (potentially) multiple, separate parts of a WorldMap.
Definition: worldmap_sector.hpp:39
Definition: object_settings.hpp:32
A 'Currenton' allows access to the currently active instance of a class via the static current() func...
Definition: currenton.hpp:30
void save_state()
Save worldmap state to squirrel state table.
Definition: worldmap.cpp:239
void set_passive_message(const std::string &message, float time)
Sets the passive message with specific time.
Definition: worldmap.cpp:266
void load_state()
Load worldmap state from squirrel state table.
Definition: worldmap.cpp:232
void change(const std::string &filename, const std::string &force_sector="", const std::string &force_spawnpoint="")
switch to another worldmap.
Definition: worldmap.cpp:247
Definition: savegame.hpp:69
void set_levels_solved(bool solved, bool perfect)
Mark all levels as solved or unsolved.
Definition: worldmap.cpp:256
Simple timer designed to be used in the update functions of objects.
Definition: timer.hpp:24
Definition: tile_set.hpp:44
This class provides functions for drawing things on screen.
Definition: drawing_context.hpp:42
void setup()
Definition: worldmap.cpp:98
Definition: worldmap.hpp:33