Freeciv21
Develop your civilization from humble roots to a global empire
freeciv::destination Class Referenceabstract

Abstraction for path finding destinations. More...

#include <path_finder.h>

+ Inheritance diagram for freeciv::destination:

Public Member Functions

virtual ~destination ()
 Destructor. More...
 

Protected Member Functions

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

Friends

class path_finder
 
class path_finder::path_finder_private
 

Detailed Description

Abstraction for path finding destinations.

The path finding algorithm can find paths not only to single tiles, but to any set of vertices. This class is used to specify which vertices are valid destinations.

Definition at line 148 of file path_finder.h.

Constructor & Destructor Documentation

◆ ~destination()

virtual freeciv::destination::~destination ( )
inlinevirtual

Destructor.

Definition at line 156 of file path_finder.h.

Member Function Documentation

◆ find_best()

path_finder::storage_type::const_iterator freeciv::destination::find_best ( const path_finder::storage_type map,
std::size_t  num_waypoints 
) const
protectedvirtual

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

The default implementation calls reached for every vertex.

Reimplemented in freeciv::tile_destination.

Definition at line 819 of file path_finder.cpp.

Referenced by freeciv::path_finder::find_path(), and freeciv::path_finder::path_finder_private::run_search().

◆ reached()

virtual bool freeciv::destination::reached ( const detail::vertex vertex) const
protectedpure virtual

Friends And Related Function Documentation

◆ path_finder

friend class path_finder
friend

Definition at line 150 of file path_finder.h.

◆ path_finder::path_finder_private

friend class path_finder::path_finder_private
friend

Definition at line 151 of file path_finder.h.