The Battle for Wesnoth  1.15.1+dev
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, const map_location &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 105 of file pathfind.hpp.

Constructor & Destructor Documentation

◆ vision_path() [1/2]

pathfind::vision_path::vision_path ( const unit viewer,
const map_location 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 581 of file pathfind.cpp.

References pathfind::paths::destinations, edges, pathfind::find_routes(), resources::gameboard, display::get_singleton(), unit::get_state(), movetype::get_vision(), unit::movement_type(), unit::STATE_SLOWED, game_board::teams(), display::viewing_team(), and unit::vision().

◆ vision_path() [2/2]

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 606 of file pathfind.cpp.

References pathfind::paths::destinations, edges, unit_map::find(), pathfind::find_routes(), resources::gameboard, display::get_singleton(), game_board::teams(), game_board::units(), unit_map::iterator_base< iter_types >::valid(), and display::viewing_team().

◆ ~vision_path()

pathfind::vision_path::~vision_path ( )
virtual

Default destructor.

Definition at line 620 of file pathfind.cpp.

Member Data Documentation

◆ edges

std::set<map_location> pathfind::vision_path::edges

The edges are the non-destination hexes bordering the destinations.

Definition at line 116 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: