A refinement of paths for use when calculating vision. More...
#include <pathfind.hpp>
Public Member Functions | |
vision_path (const unit &viewer, const map_location &loc, const std::map< map_location, int > &jamming_map) | |
Constructs a list of vision paths 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 107 of file pathfind.hpp.
pathfind::vision_path::vision_path | ( | const unit & | viewer, |
const map_location & | loc, | ||
const std::map< map_location, int > & | jamming_map | ||
) |
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). |
jamming_map | The relevant "jamming" of the costs being used. |
Definition at line 576 of file pathfind.cpp.
References pathfind::paths::destinations, edges, pathfind::find_routes(), resources::gameboard, unit::get_state(), game_board::get_team(), movetype::get_vision(), loc, unit::movement_type(), unit::side(), 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). |
jamming_map | The relevant "jamming" of the costs being used. |
Definition at line 603 of file pathfind.cpp.
References pathfind::paths::destinations, edges, unit_map::find(), pathfind::find_routes(), resources::gameboard, game_board::get_team(), loc, game_config::sounds::status::slowed, game_board::units(), and unit_map::iterator_base< iter_types >::valid().
|
virtual |
Default destructor.
Definition at line 627 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 can_see(), actions::shroud_clearer::clear_unit(), game_lua_kernel::intf_find_vision_range(), and vision_path().