30 #define ERR_NG LOG_STREAM(err, log_engine) 31 #define LOG_NG LOG_STREAM(info, log_engine) 39 const std::vector<map_location>::const_iterator & begin,
40 const std::vector<map_location>::const_iterator & end,
45 , starting_dir(dir ==
map_location::NDIRECTIONS ? moved->facing() : dir)
46 , goto_hex(moved->get_goto())
75 std::vector<map_location> rev_route =
route;
76 std::reverse(rev_route.begin(), rev_route.end());
81 if ( u == units.
end() || u_end != units.
end() ) {
83 ERR_NG <<
"Illegal 'undo' found. Possible abuse of [allow_undo]?";
94 units.
move(u->get_location(), rev_route.back());
98 u = units.
find(rev_route.back());
100 u->set_movement(saved_moves,
true);
101 u->anim_comp().set_standing();
base class for classes that clear srhoud (move/recruit/recall)
move_action(const unit_const_ptr moved, const std::vector< map_location >::const_iterator &begin, const std::vector< map_location >::const_iterator &end, int sm, int timebonus, int orig, const map_location::DIRECTION dir)
void invalidate_unit_after_move(const map_location &src, const map_location &dst)
Same as invalidate_unit() if moving the displayed unit.
config & child(config_key_type key, int n=0)
Returns the nth child with the given key, or a reference to an invalid config if there is none...
virtual const unit_map & units() const override
map_location::DIRECTION starting_dir
virtual void write(config &cfg) const
Writes this into the provided config.
virtual bool undo(int side)
Undoes this action.
std::shared_ptr< const unit > unit_const_ptr
void return_village()
Change village owner on undo.
static void clear_status_caches()
Clear this unit status cache for all units.
void execute_undo_umc_wml()
umap_retval_pair_t move(const map_location &src, const map_location &dst)
Moves a unit from location src to location dst.
void write(config &cfg) const
Encapsulates the map of the game.
Various functions related to moving units.
unit_iterator find(std::size_t id)
virtual void write(config &cfg) const
Writes this into the provided config.
DIRECTION
Valid directions which can be moved in our hexagonal world.
Standard logging facilities (interface).
Container associating units to locations.
route_t route
The hexes occupied by the affected unit during this action.
static lg::log_domain log_engine("engine")
A config object defines a single node in a WML file, with access to child nodes.
static std::string write_direction(DIRECTION dir)
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.
actions that are undoable (this does not include update_shroud and auto_shroud)
static game_display * get_singleton()