33 if(!mc.map().is_village(loc_)) {
37 std::vector<team>& teams = mc.teams();
40 if(teams.at(side_number_).owns_village(loc_)) {
43 }
catch(
const std::out_of_range&) {
47 auto undo =
static_cast<std::unique_ptr<editor_action>
>(std::make_unique<editor_action_village_delete>(loc_));
49 for(
const team&
t : teams) {
50 if(
t.owns_village(loc_)) {
51 undo = std::make_unique<editor_action_village>(loc_,
t.side() - 1);
55 perform_without_undo(mc);
This class wraps around a map to provide a concise interface for the editor to work with.
virtual const std::vector< team > & teams() const override
Const teams accessor.
void add_changed_location(const map_location &loc)