The Battle for Wesnoth  1.19.7+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:

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_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 107 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 
)

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

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

◆ ~vision_path()

pathfind::vision_path::~vision_path ( )
virtual

Default destructor.

Definition at line 627 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 117 of file pathfind.hpp.

Referenced by can_see(), actions::shroud_clearer::clear_unit(), game_lua_kernel::intf_find_vision_range(), and vision_path().


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