Freeciv21
Develop your civilization from humble roots to a global empire
freeciv::tile_destination Class Reference

A path finding destination that accepts any path leading to a specific tile. More...

#include <path_finder.h>

+ Inheritance diagram for freeciv::tile_destination:
+ Collaboration diagram for freeciv::tile_destination:

Public Member Functions

 tile_destination (const tile *destination)
 Constructor. More...
 
 ~tile_destination ()
 Destructor. More...
 
- Public Member Functions inherited from freeciv::destination
virtual ~destination ()
 Destructor. More...
 

Protected Member Functions

bool reached (const detail::vertex &vertex) const override
 Checks if a vertex should be considered as being at the destination. More...
 
path_finder::storage_type::const_iterator find_best (const path_finder::storage_type &map, std::size_t num_waypoints) const override
 Returns an iterator to the best vertex that is a destination vertex. More...
 

Private Attributes

const tilem_destination
 

Detailed Description

A path finding destination that accepts any path leading to a specific tile.

Definition at line 173 of file path_finder.h.

Constructor & Destructor Documentation

◆ tile_destination()

freeciv::tile_destination::tile_destination ( const tile destination)
inlineexplicit

Constructor.

Definition at line 178 of file path_finder.h.

◆ ~tile_destination()

freeciv::tile_destination::~tile_destination ( )
inline

Destructor.

Definition at line 187 of file path_finder.h.

Member Function Documentation

◆ find_best()

path_finder::storage_type::const_iterator freeciv::tile_destination::find_best ( const path_finder::storage_type map,
std::size_t  num_waypoints 
) const
overrideprotectedvirtual

Returns an iterator to the best vertex that is a destination vertex.

The default implementation calls reached for every vertex.

This implementation only checks relevant nodes.

Reimplemented from freeciv::destination.

Definition at line 849 of file path_finder.cpp.

◆ reached()

bool freeciv::tile_destination::reached ( const detail::vertex vertex) const
overrideprotectedvirtual

Checks if a vertex should be considered as being at the destination.

Implements freeciv::destination.

Definition at line 838 of file path_finder.cpp.

Referenced by find_best().

Member Data Documentation

◆ m_destination

const tile* freeciv::tile_destination::m_destination
private

Definition at line 196 of file path_finder.h.

Referenced by find_best(), and reached().