21 #define GETTEXT_DOMAIN "wesnoth-editor"
30 #include <boost/scoped_ptr.hpp>
43 return undo.release();
64 std::unique_ptr<editor_action> undo;
65 if (unit_it != units.
end()) {
68 return undo.release();
77 ERR_ED <<
"Could not delete unit on " <<
loc_.
x <<
"/" <<
loc_.
y << std::endl;
94 return undo.release();
131 return undo.release();
139 if (unit_it != units.
end()) {
141 unit_it->anim_comp().set_standing();
void add_changed_location(const map_location &loc)
editor_action * perform(map_context &mc) const
Perform the action, returning an undo action that, when performed, shall reverse any effects of this ...
editor_action_unit_facing * clone() const
Action cloning.
editor_action_unit_delete(map_location loc)
editor_action_unit_replace * clone() const
Action cloning.
void perform_without_undo(map_context &mc) const
Perform the action without creating an undo action.
editor_action * perform(map_context &mc) const
Perform the action, returning an undo action that, when performed, shall reverse any effects of this ...
editor_action * perform(map_context &mc) const
Perform the action, returning an undo action that, when performed, shall reverse any effects of this ...
void perform_without_undo(map_context &mc) const
Perform the action without creating an undo action.
editor_action_unit * clone() const
Action cloning.
void perform_without_undo(map_context &mc) const
Perform the action without creating an undo action.
static void clear_status_caches()
Clear the unit status cache for all units.
editor_action_unit_replace(map_location loc, map_location new_loc)
editor_action_unit_delete * 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 ...
Manage the empty-palette in the editor.
unit_animation_component & anim_comp() const
std::pair< unit_iterator, bool > add(const map_location &l, const unit &u)
Adds a copy of unit u at location l of the map.
place a new unit on the map
editor_action_unit(map_location loc, const unit &u)
unit_map & get_units()
Get the unit map from the current map context object.
Base class for all editor actions.
editor_action_unit_facing(map_location loc, map_location::DIRECTION new_direction, map_location::DIRECTION old_direction)
void perform_without_undo(map_context &mc) const
Perform the action without creating an undo action.
This class wraps around a map to provide a concise interface for the editor to work with...
std::pair< unit_iterator, bool > move(const map_location &src, const map_location &dst)
Moves a unit from location src to location dst.
size_t erase(const map_location &l)
Erases the unit at location l, if any.
Remove a unit from the map.
map_location::DIRECTION old_direction_
Container associating units to locations.
map_location::DIRECTION new_direction_
void set_standing(bool with_bars=true)
Sets the animation state to standing.
unit_iterator find(size_t id)