15 #define ERR_NG LOG_STREAM(err, log_engine)
16 #define LOG_NG LOG_STREAM(info, log_engine)
49 std::vector<map_location> rev_route =
route;
50 std::reverse(rev_route.begin(), rev_route.end());
55 if ( u == units.
end() || u_end != units.
end() ) {
57 ERR_NG <<
"Illegal 'undo' found. Possible abuse of [allow_undo]?" << std::endl;
68 units.
move(u->get_location(), rev_route.back());
72 u = units.
find(rev_route.back());
74 u->set_movement(saved_moves,
true);
75 u->anim_comp().set_standing();
93 if ( u == units.
end() ) {
94 ERR_NG <<
"Illegal movement 'redo'." << std::endl;
105 units.
move(u->get_location(),
route.back());
111 u->set_movement(saved_moves,
true);
112 u->anim_comp().set_standing();
void invalidate_unit_after_move(const map_location &src, const map_location &dst)
Same as invalidate_unit() if moving the displayed unit.
void take_village()
Change village owner on redo.
virtual bool redo(int side)
Redoes this action.
map_location::DIRECTION starting_dir
virtual bool undo(int side)
Undoes this action.
void return_village()
Change village owner on undo.
static void clear_status_caches()
Clear the unit status cache for all units.
void redo(const config &dst)
pointer get_shared_ptr() const
void execute_undo_umc_wml()
virtual void write(config &cfg) const
Writes this into the provided config.
Encapsulates the map of the game.
Various functions related to moving units.
virtual void write(config &cfg) const
Writes this into the provided config.
t_route route
The hexes occupied by the affected unit during this action.
std::pair< unit_iterator, bool > move(const map_location &src, const map_location &dst)
Moves a unit from location src to location dst.
config & child(const std::string &key, int n=0)
Returns the nth child with the given key, or a reference to an invalid config if there is none...
Standard logging facilities (interface).
Container associating units to locations.
void execute_redo_umc_wml()
static lg::log_domain log_engine("engine")
void write(config &cfg) const
unit_iterator find(size_t id)
A config object defines a single node in a WML file, with access to child nodes.
static std::string write_direction(DIRECTION dir)
config replay_data
the replay data to do this action, this is only !empty() when this action is on the redo stack we nee...
Display units performing various actions: moving, attacking, and dying.
void move_unit(const std::vector< map_location > &path, unit_ptr u, bool animate, map_location::DIRECTION dir, bool force_scroll)
Display a unit moving along a given path.