A refinement of paths for use when calculating vision. More...
#include <pathfind.hpp>
Public Member Functions | |
vision_path (const unit &viewer, map_location const &loc, const std::map< map_location, int > &jamming_map) | |
Construct a list of seen hexes for a unit. More... | |
vision_path (const movetype::terrain_costs &view_costs, bool slowed, int sight_range, const map_location &loc, const std::map< map_location, int > &jamming_map) | |
Constructs a list of vision paths for a unit. More... | |
virtual | ~vision_path () |
Default destructor. More... | |
Public Member Functions inherited from pathfind::paths | |
paths () | |
paths (const unit &u, bool force_ignore_zocs, bool allow_teleport, const team &viewing_team, int additional_turns=0, bool see_all=false, bool ignore_units=false) | |
Construct a list of paths for the specified unit. More... | |
virtual | ~paths () |
Virtual destructor (default processing). More... | |
Public Attributes | |
std::set< map_location > | edges |
The edges are the non-destination hexes bordering the destinations. More... | |
Public Attributes inherited from pathfind::paths | |
dest_vect | destinations |
A refinement of paths for use when calculating vision.
Definition at line 106 of file pathfind.hpp.
pathfind::vision_path::vision_path | ( | const unit & | viewer, |
map_location const & | loc, | ||
const std::map< map_location, int > & | jamming_map | ||
) |
Construct a list of seen hexes for a unit.
Constructs a list of vision paths for a unit.
This is used to construct a list of hexes that the indicated unit can see. It differs from pathfinding in that it will only ever go out one turn, and that it will also collect a set of border hexes (the "one hex beyond" movement to which vision extends).
viewer | The unit doing the viewing. |
loc | The location from which the viewing occurs (does not have to be the unit's location). |
Definition at line 565 of file pathfind.cpp.
References pathfind::paths::destinations, edges, pathfind::find_routes(), unit::get_state(), movetype::get_vision(), unit::movement_type(), unit::STATE_SLOWED, and unit::vision().
pathfind::vision_path::vision_path | ( | const movetype::terrain_costs & | view_costs, |
bool | slowed, | ||
int | sight_range, | ||
const map_location & | loc, | ||
const std::map< map_location, int > & | jamming_map | ||
) |
Constructs a list of vision paths for a unit.
This constructor is provided so that only the relevant portion of a unit's data is required to construct the vision paths.
view_costs | The vision costs of the unit doing the viewing. |
slowed | Whether or not the unit is slowed. |
sight_range | The vision() of the unit. |
loc | The location from which the viewing occurs (does not have to be the unit's location). |
Definition at line 589 of file pathfind.cpp.
References pathfind::paths::destinations, edges, and pathfind::find_routes().
|
virtual |
Default destructor.
Definition at line 601 of file pathfind.cpp.
std::set<map_location> pathfind::vision_path::edges |
The edges are the non-destination hexes bordering the destinations.
Definition at line 117 of file pathfind.hpp.
Referenced by actions::shroud_clearer::clear_unit(), and vision_path().