22 #define GETTEXT_DOMAIN "wesnoth-editor"
37 auto undo = std::make_unique<editor_action_unit_delete>(
loc_);
38 perform_without_undo(mc);
56 if(unit_it != units.
end()) {
57 auto undo = std::make_unique<editor_action_unit>(
loc_, *unit_it);
58 perform_without_undo(mc);
79 auto undo = std::make_unique<editor_action_unit_replace>(new_loc_,
loc_);
80 perform_without_undo(mc);
113 auto undo = std::make_unique<editor_action_unit_facing>(
loc_, old_direction_, new_direction_);
114 perform_without_undo(mc);
123 if(unit_it != units.
end()) {
125 unit_it->anim_comp().set_standing();
#define IMPLEMENT_ACTION(id)
Helper macro to implement common action methods.
Remove a unit from the map.
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.
map_location::direction new_direction_
void perform_without_undo(map_context &mc) const override
Perform the action without creating an undo action.
place a new unit on the map
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 wraps around a map to provide a concise interface for the editor to work with.
virtual const unit_map & units() const override
Const units accessor.
void add_changed_location(const map_location &loc)
void set_standing(bool with_bars=true)
Sets the animation state to standing.
Container associating units to locations.
unit_iterator find(std::size_t id)
std::size_t erase(const map_location &l)
Erases the unit at location l, if any.
umap_retval_pair_t add(const map_location &l, const unit &u)
Adds a copy of unit u at location l of the map.
umap_retval_pair_t move(const map_location &src, const map_location &dst)
Moves a unit from location src to location dst.
This class represents a single unit of a specific type.
static void clear_status_caches()
Clear this unit status cache for all units.
unit_animation_component & anim_comp() const
Manage the empty-palette in the editor.