The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Member Functions | Public Attributes | List of all members
pathfind::vision_path Struct Reference

A refinement of paths for use when calculating vision. More...

#include <pathfind.hpp>

Inheritance diagram for pathfind::vision_path:
Inheritance graph

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_locationedges
 The edges are the non-destination hexes bordering the destinations. More...
 
- Public Attributes inherited from pathfind::paths
dest_vect destinations
 

Detailed Description

A refinement of paths for use when calculating vision.

Definition at line 106 of file pathfind.hpp.

Constructor & Destructor Documentation

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).

Parameters
viewerThe unit doing the viewing.
locThe 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.

Parameters
view_costsThe vision costs of the unit doing the viewing.
slowedWhether or not the unit is slowed.
sight_rangeThe vision() of the unit.
locThe 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().

pathfind::vision_path::~vision_path ( )
virtual

Default destructor.

Definition at line 601 of file pathfind.cpp.

Member Data Documentation

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().


The documentation for this struct was generated from the following files: