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

A constraint that restricts the search to tiles known by the player. More...

#include <path_finder.h>

+ Inheritance diagram for freeciv::tile_known_constraint:
+ Collaboration diagram for freeciv::tile_known_constraint:

Public Member Functions

 tile_known_constraint (const player *player)
 Constructor. More...
 
 ~tile_known_constraint ()=default
 Destructor. More...
 
bool is_allowed (const path::step &step) const override
 Whether a step should be used in the search. More...
 
- Public Member Functions inherited from freeciv::step_constraint
virtual ~step_constraint ()=default
 Destructor. More...
 

Private Attributes

const playerm_player
 

Detailed Description

A constraint that restricts the search to tiles known by the player.

Definition at line 274 of file path_finder.h.

Constructor & Destructor Documentation

◆ tile_known_constraint()

freeciv::tile_known_constraint::tile_known_constraint ( const player player)
inlineexplicit

Constructor.

Definition at line 277 of file path_finder.h.

◆ ~tile_known_constraint()

freeciv::tile_known_constraint::~tile_known_constraint ( )
default

Destructor.

Member Function Documentation

◆ is_allowed()

bool freeciv::tile_known_constraint::is_allowed ( const path::step step) const
overridevirtual

Whether a step should be used in the search.

Steps are checked before any turn change calculation is performed.

Implements freeciv::step_constraint.

Definition at line 897 of file path_finder.cpp.

Member Data Documentation

◆ m_player

const player* freeciv::tile_known_constraint::m_player
private

Definition at line 285 of file path_finder.h.

Referenced by is_allowed().