15 #ifndef EDITOR_MAP_CONTEXT_HPP_INCLUDED
16 #define EDITOR_MAP_CONTEXT_HPP_INCLUDED
29 #include <boost/utility.hpp>
30 #include <boost/scoped_ptr.hpp>
96 void save_area(
const std::set<map_location>& area) {
100 void new_area(
const std::set<map_location>& area) {
134 virtual const std::vector<team>&
teams()
const {
192 music_tracks_.insert(std::pair<std::string, sound::music_track>(track.
id(), track));
201 bool one_layer_only =
false);
207 bool one_layer_only =
false);
214 bool one_layer_only =
false);
248 bool fog,
bool shroud, team::SHARE_VISION share_vision,
249 team::CONTROLLER
controller,
bool hidden,
bool no_leader);
493 typedef std::map<std::string, sound::music_track>
music_map;
std::multimap< map_location, overlay > overlay_map
bool needs_terrain_rebuild() const
Getter for the terrain rebuild flag.
void add_changed_location(const map_location &loc)
int actions_since_save_
Number of actions performed since the map was saved.
action_stack undo_stack_
The undo stack.
bool victory_defeated() const
std::string map_data_key_
When a scenario file is loaded, the referenced map is loaded instead.
editor_action * last_redo_action()
void undo()
Un-does the last action, and puts it in the redo stack for a possible redo.
virtual const gamemap & map() const
editor_map map_
The map object of this map_context.
game_classification game_classification_
std::set< map_location > starting_position_label_locs_
Cache of set starting position labels.
bool needs_labels_reset() const
Getter for the labels reset flag.
void add_to_playlist(const sound::music_track &track)
bool needs_terrain_rebuild_
Refresh flag indicating the terrain in the map has changed and requires a rebuild.
void perform_action_between_stacks(action_stack &from, action_stack &to)
Perform an action at the back of one stack, and then move it to the back of the other stack...
void save_area(const std::set< map_location > &area)
void new_side()
Adds a new side to the map.
bool save_scenario()
Saves the scenario under the current filename.
virtual ~map_context()
Map context destructor.
const unit_map & get_units() const
void new_area(const std::set< map_location > &area)
void set_active_area(int index)
map_labels & get_labels()
bool needs_reload_
Refresh flag indicating the map in this context should be completely reloaded by the display...
virtual const std::vector< std::string > & hidden_label_categories() const
bool everything_changed() const
map_context(const editor_map &map, const display &disp, bool pure_map, const config &schedule)
Create a map context from an existing map.
void redo()
Re-does a previously undid action, and puts it back in the undo stack.
mp_game_settings & get_mp_settings()
const std::string & get_filename() const
void draw_terrain(const t_translation::t_terrain &terrain, const map_location &loc, bool one_layer_only=false)
Draw a terrain on a single location on the map.
void clear_stack(action_stack &stack)
Clears an action stack and deletes all its contents.
void set_hidden(bool value)
std::string scenario_description_
std::string scenario_name_
void set_needs_reload(bool value=true)
Setter for the reload flag.
const std::string & get_description() const
void clear_modified()
Clear the modified state.
void partial_undo()
Un-does a single step from a undo action chain.
bool embedded_
Whether the map context refers to a map embedded in a scenario file.
void set_scenario_setup(const std::string &id, const std::string &name, const std::string &description, int turns, int xp_mod, bool victory_defeated, bool random_time)
TODO.
const std::set< map_location > changed_locations() const
void remove_area(int index)
void set_map(const editor_map &map)
virtual const std::vector< team > & teams() const
void set_side_setup(int side, const std::string &id, const std::string &name, int gold, int income, int village_gold, int village_support, bool fog, bool shroud, team::SHARE_VISION share_vision, team::CONTROLLER controller, bool hidden, bool no_leader)
TODO.
overlay_map & get_overlays()
game_classification & get_classification()
bool pure_map_
Whether the map context refers to a file containing only the pure map data.
static const size_t max_action_stack_size_
Action stack (i.e.
This class stores all the data for a single 'side' (in game nomenclature).
const std::string & get_name() const
tod_manager * get_time_manager()
std::map< std::string, sound::music_track > music_map
const editor_map & get_map() const
Map accessor - const version.
void set_local_starting_time(int time)
TODO.
std::vector< team > teams_
std::deque< editor_action * > action_stack
Container type used to store actions in the undo and redo stacks.
void remove_side()
removes the last side from the scenario
void reset_starting_position_labels(display &disp)
GLsizei const GLfloat * value
void draw_terrain_actual(const t_translation::t_terrain &terrain, const map_location &loc, bool one_layer_only=false)
Actual drawing function used by both overloaded variants of draw_terrain.
void set_embedded(bool v)
editor_map & get_map()
Map accessor.
Encapsulates the map of the game.
void replace_schedule(const std::vector< time_of_day > &schedule)
void add_to_recent_files()
Adds the map to the editor's recent files list.
void set_starting_time(int time)
TODO.
bool save_map()
Saves the map under the current filename.
editor_action * last_undo_action()
Manage the empty-palette in the editor.
void perform_action(const editor_action &action)
Performs an action (thus modifying the map).
static const ::config * terrain
The terrain used to create the cache.
A terrain string which is converted to a terrain is a string with 1 or 2 layers the layers are separa...
void set_needs_terrain_rebuild(bool value=true)
Setter for the terrain rebuild flag.
virtual const unit_map & units() const
Const accessor names needed to implement "display_context" interface.
bool needs_labels_reset_
Refresh flag indicating the labels in the map have changed.
Encapsulates the map of the game.
void perform_partial_action(const editor_action &action)
Performs a partial action, assumes that the top undo action has been modified to maintain coherent st...
void clear_changed_locations()
void set_starting_position_labels(display &disp)
void set_labels(display &disp)
std::vector< team > & get_teams()
Get the team from the current map context object.
void set_everything_changed()
This class adds extra editor-specific functionality to a normal gamemap.
Game configuration data as global variables.
unit_map & get_units()
Get the unit map from the current map context object.
Base class for all editor actions.
Internal representation of music tracks.
const std::string & get_map_data_key() const
void load_scenario(const config &game_config)
bool random_start_time() const
This class wraps around a map to provide a concise interface for the editor to work with...
action_stack redo_stack_
The redo stack.
std::vector< std::string > lbl_categories_
GLuint const GLchar * name
boost::scoped_ptr< tod_manager > tod_manager_
bool needs_reload() const
Getter for the reload flag.
void clear_undo_redo()
Clear the undo and redo stacks.
void set_needs_labels_reset(bool value=true)
Setter for the labels reset flag.
bool is_in_playlist(std::string track_id)
void set_filename(const std::string &fn)
void replace_local_schedule(const std::vector< time_of_day > &schedule)
Replace the [time]s of the currently active area.
Container associating units to locations.
int get_active_area() const
std::string filename_
The actual filename of this map.
void trim_stack(action_stack &stack)
Checks if an action stack reached its capacity and removes the front element if so.
std::set< map_location > changed_locations_
void clear_starting_position_labels(display &disp)
A config object defines a single node in a WML file, with access to child nodes.
GLsizei const GLcharARB ** string
mp_game_settings mp_settings_
bool select_area(int index)
Select the nth tod area.
const std::string & id() const
const std::string & get_id() const