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

Allows one to limit the scope a path finding search. More...

#include <path_finder.h>

+ Inheritance diagram for freeciv::step_constraint:

Public Member Functions

virtual ~step_constraint ()=default
 Destructor. More...
 
virtual bool is_allowed (const path::step &step) const =0
 Whether a step should be used in the search. More...
 

Detailed Description

Allows one to limit the scope a path finding search.

This class allows to limit the scope of the search by forbidding some steps. Subclass from this class and implement is_allowed to create a constraint with your own critieria.

See also
path_finder::set_constraint

Definition at line 258 of file path_finder.h.

Constructor & Destructor Documentation

◆ ~step_constraint()

virtual freeciv::step_constraint::~step_constraint ( )
virtualdefault

Destructor.

Member Function Documentation

◆ is_allowed()

virtual bool freeciv::step_constraint::is_allowed ( const path::step step) const
pure virtual

Whether a step should be used in the search.

Steps are checked before any turn change calculation is performed.

Implemented in freeciv::tile_known_constraint.