19 #define GETTEXT_DOMAIN "wesnoth-editor"
35 std::unique_ptr<editor_action> undo;
45 if (
i->owns_village(
loc_))
50 return undo.release();
57 if (
i->owns_village(
loc_))
58 i->lose_village(
loc_);
73 std::unique_ptr<editor_action> undo;
76 for(std::vector<team>::const_iterator
i = teams.begin();
i != teams.end(); ++
i) {
77 if (
i->owns_village(
loc_)) {
83 return undo.release();
90 if (
i->owns_village(
loc_)) {
91 i->lose_village(
loc_);
void add_changed_location(const map_location &loc)
editor_action_village_delete(map_location loc)
bool owns_village(const map_location &loc) const
bool is_village(const map_location &loc) const
Sets the ownership of a village to the current side.
void perform_without_undo(map_context &mc) const
Perform the action without creating an undo action.
static std::vector< team > *& teams
This class stores all the data for a single 'side' (in game nomenclature).
editor_action_village * clone() const
Action cloning.
editor_action * perform(map_context &mc) const
Perform the action, returning an undo action that, when performed, shall reverse any effects of this ...
editor_map & get_map()
Map accessor.
editor_action * perform(map_context &mc) const
Perform the action, returning an undo action that, when performed, shall reverse any effects of this ...
Manage the empty-palette in the editor.
editor_action_village_delete * clone() const
Action cloning.
std::vector< team > & get_teams()
Get the team from the current map context object.
Base class for all editor actions.
This class wraps around a map to provide a concise interface for the editor to work with...
void perform_without_undo(map_context &mc) const
Perform the action without creating an undo action.
editor_action_village(map_location loc, int side_number)
Clears the ownership of a village.