20 #define GETTEXT_DOMAIN "wesnoth-editor"
32 LOG_ED <<
"Extending by " << loc;
39 std::set<map_location> undo_locs;
41 undo_locs.insert(loc);
46 return std::make_unique<editor_action_select>(undo_locs);
62 LOG_ED <<
"Checking " << loc;
63 if(!map.in_selection(loc)) {
64 LOG_ED <<
"Extending by " << loc;
72 std::set<map_location> undo_locs;
75 undo_locs.insert(loc);
81 return std::make_unique<editor_action_select>(undo_locs);
96 std::set<map_location> current = mc.map().selection();
97 mc.map().select_all();
99 std::set<map_location> all = mc.map().selection();
100 std::set<map_location> undo_locs;
103 all.begin(), all.end(), current.begin(), current.end(), std::inserter(undo_locs, undo_locs.begin()));
105 mc.set_everything_changed();
106 return std::make_unique<editor_action_select>(undo_locs);
119 std::set<map_location> current = mc.map().selection();
120 mc.map().clear_selection();
121 mc.set_everything_changed();
122 return std::make_unique<editor_action_select>(current);
135 perform_without_undo(mc);
136 return std::make_unique<editor_action_select_inverse>();
#define IMPLEMENT_ACTION(id)
Helper macro to implement common action methods.
std::set< map_location > area_
Deselect the given locations.
std::unique_ptr< editor_action > perform(map_context &mc) const override
Perform the action, returning an undo action that, when performed, shall reverse any effects of this ...
void perform_without_undo(map_context &mc) const override
Perform the action without creating an undo action.
void perform_without_undo(map_context &mc) const override
Perform the action without creating an undo action.
void perform_without_undo(map_context &mc) const override
Perform the action without creating an undo action.
void perform_without_undo(map_context &mc) const override
Perform the action without creating an undo action.
Select the given locations.
std::unique_ptr< editor_action > perform(map_context &mc) const override
Perform the action, returning an undo action that, when performed, shall reverse any effects of this ...
void perform_without_undo(map_context &mc) const override
Perform the action without creating an undo action.
Base class for all editor actions.
This class adds extra editor-specific functionality to a normal gamemap.
bool add_to_selection(const map_location &loc)
Add a location to the selection.
void invert_selection()
Invert the selection, i.e.
void select_all()
Select all map hexes.
bool in_selection(const map_location &loc) const
bool remove_from_selection(const map_location &loc)
Remove a location to the selection.
void clear_selection()
Clear the selection.
This class wraps around a map to provide a concise interface for the editor to work with.
void set_everything_changed()
virtual const editor_map & map() const override
Const map accessor.
void add_changed_location(const map_location &loc)
void set(CURSOR_TYPE type)
Use the default parameter to reset cursors.
Manage the empty-palette in the editor.
Encapsulates the map of the game.