The Battle for Wesnoth  1.19.7+dev
Public Member Functions | Private Attributes | List of all members
pathfind::teleport_map Class Reference

#include <teleport.hpp>

Public Member Functions

 teleport_map (const std::vector< teleport_group > &teleport_groups, const unit &u, const team &viewing_team, const bool see_all, const bool ignore_units, const bool check_vision)
 
 teleport_map ()
 
const std::unordered_set< map_location > & get_adjacents (map_location loc) const
 
const std::unordered_set< map_location > & get_sources () const
 Returns the locations that are an entrance of the tunnel. More...
 
const std::unordered_set< map_location > & get_targets () const
 Returns the locations that are an exit of the tunnel. More...
 
bool empty () const
 

Private Attributes

std::unordered_map< map_location, std::unordered_set< map_location > > teleport_map_
 
std::unordered_set< map_locationsources_
 
std::unordered_set< map_locationtargets_
 
std::unordered_set< map_locationempty_set_
 

Detailed Description

Definition at line 98 of file teleport.hpp.

Constructor & Destructor Documentation

◆ teleport_map() [1/2]

pathfind::teleport_map::teleport_map ( const std::vector< teleport_group > &  teleport_groups,
const unit u,
const team viewing_team,
const bool  see_all,
const bool  ignore_units,
const bool  check_vision 
)

◆ teleport_map() [2/2]

pathfind::teleport_map::teleport_map ( )
inline

Definition at line 119 of file teleport.hpp.

Member Function Documentation

◆ empty()

bool pathfind::teleport_map::empty ( ) const
inline

Definition at line 137 of file teleport.hpp.

References sources_.

Referenced by pathfind::a_star_search().

◆ get_adjacents()

const std::unordered_set< map_location > & pathfind::teleport_map::get_adjacents ( map_location  loc) const
Parameters
locthe map location for which we want to know the adjacent hexes
Todo:
what does this function actually have to do with adjacent hexes?

Definition at line 231 of file teleport.cpp.

References empty_set_, loc, and teleport_map_.

Referenced by pathfind::a_star_search(), and pathfind::find_routes().

◆ get_sources()

const std::unordered_set< map_location > & pathfind::teleport_map::get_sources ( ) const

Returns the locations that are an entrance of the tunnel.

Definition at line 241 of file teleport.cpp.

References sources_.

◆ get_targets()

const std::unordered_set< map_location > & pathfind::teleport_map::get_targets ( ) const

Returns the locations that are an exit of the tunnel.

Definition at line 246 of file teleport.cpp.

References targets_.

Referenced by pathfind::a_star_search().

Member Data Documentation

◆ empty_set_

std::unordered_set<map_location> pathfind::teleport_map::empty_set_
private

Definition at line 145 of file teleport.hpp.

Referenced by get_adjacents().

◆ sources_

std::unordered_set<map_location> pathfind::teleport_map::sources_
private

Definition at line 143 of file teleport.hpp.

Referenced by empty(), get_sources(), and teleport_map().

◆ targets_

std::unordered_set<map_location> pathfind::teleport_map::targets_
private

Definition at line 144 of file teleport.hpp.

Referenced by get_targets(), and teleport_map().

◆ teleport_map_

std::unordered_map<map_location, std::unordered_set<map_location> > pathfind::teleport_map::teleport_map_
private

Definition at line 142 of file teleport.hpp.

Referenced by get_adjacents(), and teleport_map().


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