Freeciv21
Develop your civilization from humble roots to a global empire
pf_tools.h File Reference
#include "path_finding.h"
+ Include dependency graph for pf_tools.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  pft_amphibious
 

Functions

void pft_fill_unit_parameter (struct pf_parameter *parameter, const struct unit *punit)
 Fill classic parameters for an unit. More...
 
void pft_fill_unit_overlap_param (struct pf_parameter *parameter, const struct unit *punit)
 Switch on one tile overlapping into the non-native terrain. More...
 
void pft_fill_unit_attack_param (struct pf_parameter *parameter, const struct unit *punit)
 pft_fill_*_attack_param() base function. More...
 
void pft_fill_utype_parameter (struct pf_parameter *parameter, const struct unit_type *punittype, struct tile *pstart_tile, struct player *pplayer)
 Fill classic parameters for an unit type. More...
 
void pft_fill_utype_overlap_param (struct pf_parameter *parameter, const struct unit_type *punittype, struct tile *pstart_tile, struct player *pplayer)
 Switch on one tile overlapping into the non-native terrain. More...
 
void pft_fill_reverse_parameter (struct pf_parameter *parameter, struct tile *target_tile)
 Fill default parameters for reverse map. More...
 
void pft_fill_amphibious_parameter (struct pft_amphibious *parameter)
 Fill parameters for combined sea-land movement. More...
 
enum tile_behavior no_fights_or_unknown (const struct tile *ptile, enum known_type known, const struct pf_parameter *param)
 PF callback to prohibit going into the unknown. More...
 
enum tile_behavior no_fights (const struct tile *ptile, enum known_type known, const struct pf_parameter *param)
 PF callback to prohibit attacking anyone. More...
 
enum tile_behavior no_intermediate_fights (const struct tile *ptile, enum known_type known, const struct pf_parameter *param)
 PF callback to prohibit attacking anyone, except at the destination. More...
 

Function Documentation

◆ no_fights()

enum tile_behavior no_fights ( const struct tile ptile,
enum known_type  known,
const struct pf_parameter param 
)

PF callback to prohibit attacking anyone.

Definition at line 432 of file pf_tools.cpp.

Referenced by dai_fill_unit_param().

◆ no_fights_or_unknown()

enum tile_behavior no_fights_or_unknown ( const struct tile ptile,
enum known_type  known,
const struct pf_parameter param 
)

PF callback to prohibit going into the unknown.

Also makes sure we don't plan to attack anyone.

Definition at line 432 of file pf_tools.cpp.

Referenced by find_best_city_placement().

◆ no_intermediate_fights()

enum tile_behavior no_intermediate_fights ( const struct tile ptile,
enum known_type  known,
const struct pf_parameter param 
)

PF callback to prohibit attacking anyone, except at the destination.

Definition at line 432 of file pf_tools.cpp.

Referenced by dai_fill_unit_param(), and dai_manage_diplomat().

◆ pft_fill_amphibious_parameter()

void pft_fill_amphibious_parameter ( struct pft_amphibious parameter)

Fill parameters for combined sea-land movement.

This is suitable for the case of a land unit riding a ferry. The starting position of the ferry is taken to be the starting position for the PF. The passenger is assumed to initailly be on the given ferry. The destination may be inland, in which case the passenger will ride the ferry to a beach head, disembark, then continue on land. One complexity of amphibious movement is that the movement rate on land might be different from that at sea. We therefore scale up the movement rates (and the corresponding movement consts) to the product of the two rates.

Definition at line 955 of file pf_tools.cpp.

◆ pft_fill_reverse_parameter()

void pft_fill_reverse_parameter ( struct pf_parameter parameter,
struct tile target_tile 
)

Fill default parameters for reverse map.

Definition at line 923 of file pf_tools.cpp.

Referenced by pf_reverse_map_new().

◆ pft_fill_unit_attack_param()

void pft_fill_unit_attack_param ( struct pf_parameter parameter,
const struct unit punit 
)

pft_fill_*_attack_param() base function.

Consider attacking and non-attacking possibilities properly.

Definition at line 913 of file pf_tools.cpp.

Referenced by dai_fill_unit_param(), find_rampage_target(), find_something_to_kill(), and goto_is_sane().

◆ pft_fill_unit_overlap_param()

void pft_fill_unit_overlap_param ( struct pf_parameter parameter,
const struct unit punit 
)

Switch on one tile overlapping into the non-native terrain.

For sea/land bombardment and for ferries.

Definition at line 871 of file pf_tools.cpp.

Referenced by dai_fill_unit_param(), find_best_city_placement(), and find_something_to_kill().

◆ pft_fill_unit_parameter()

◆ pft_fill_utype_overlap_param()

void pft_fill_utype_overlap_param ( struct pf_parameter parameter,
const struct unit_type punittype,
struct tile pstart_tile,
struct player pplayer 
)

Switch on one tile overlapping into the non-native terrain.

For sea/land bombardment and for ferry types.

Definition at line 857 of file pf_tools.cpp.

Referenced by find_something_to_kill().

◆ pft_fill_utype_parameter()

void pft_fill_utype_parameter ( struct pf_parameter parameter,
const struct unit_type punittype,
struct tile pstart_tile,
struct player pplayer 
)

Fill classic parameters for an unit type.

Definition at line 809 of file pf_tools.cpp.

Referenced by process_attacker_want().