Freeciv-3.2
Loading...
Searching...
No Matches
Data Structures | Functions
pf_tools.h File Reference
#include "path_finding.h"

Go to the source code of this file.

Data Structures

struct  pft_amphibious
 

Functions

void pft_fill_unit_parameter (struct pf_parameter *parameter, const struct civ_map *nmap, const struct unit *punit)
 
void pft_fill_unit_overlap_param (struct pf_parameter *parameter, const struct civ_map *nmap, const struct unit *punit)
 
void pft_fill_unit_attack_param (struct pf_parameter *parameter, const struct civ_map *nmap, const struct unit *punit)
 
void pft_fill_utype_parameter (struct pf_parameter *parameter, const struct civ_map *nmap, const struct unit_type *punittype, struct tile *pstart_tile, struct player *pplayer)
 
void pft_fill_utype_overlap_param (struct pf_parameter *parameter, const struct civ_map *nmap, const struct unit_type *punittype, struct tile *pstart_tile, struct player *pplayer)
 
void pft_fill_utype_attack_param (struct pf_parameter *parameter, const struct civ_map *nmap, const struct unit_type *punittype, struct tile *pstart_tile, struct player *pplayer)
 
void pft_fill_reverse_parameter (const struct civ_map *nmap, struct pf_parameter *parameter, struct tile *target_tile)
 
void pft_fill_amphibious_parameter (struct pft_amphibious *parameter)
 
enum tile_behavior no_fights_or_unknown (const struct tile *ptile, enum known_type known, const struct pf_parameter *param)
 
enum tile_behavior no_fights (const struct tile *ptile, enum known_type known, const struct pf_parameter *param)
 
enum tile_behavior no_intermediate_fights (const struct tile *ptile, enum known_type known, const struct pf_parameter *param)
 

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 509 of file pf_tools.c.

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 493 of file pf_tools.c.

Referenced by find_best_city_placement(), manage_auto_explorer(), and no_fights_or_unknown_goto().

◆ 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 524 of file pf_tools.c.

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 initially to 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 994 of file pf_tools.c.

◆ pft_fill_reverse_parameter()

void pft_fill_reverse_parameter ( const struct civ_map nmap,
struct pf_parameter parameter,
struct tile target_tile 
)

Fill default parameters for reverse map.

Definition at line 960 of file pf_tools.c.

Referenced by pf_reverse_map_new().

◆ pft_fill_unit_attack_param()

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

pft_fill_*_attack_param() base function.

Consider attacking and non-attacking possibilities properly.

Definition at line 949 of file pf_tools.c.

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 civ_map nmap,
const struct unit punit 
)

Switch on one tile overlapping into the non-native terrain. For sea/land bombardment and for ferries.

Definition at line 891 of file pf_tools.c.

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

◆ pft_fill_unit_parameter()

void pft_fill_unit_parameter ( struct pf_parameter parameter,
const struct civ_map nmap,
const struct unit punit 
)

◆ pft_fill_utype_attack_param()

void pft_fill_utype_attack_param ( struct pf_parameter parameter,
const struct civ_map nmap,
const struct unit_type punittype,
struct tile pstart_tile,
struct player pplayer 
)

pft_fill_*_attack_param() base function.

Consider attacking and non-attacking possibilities properly.

Definition at line 933 of file pf_tools.c.

◆ pft_fill_utype_overlap_param()

void pft_fill_utype_overlap_param ( struct pf_parameter parameter,
const struct civ_map nmap,
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 876 of file pf_tools.c.

Referenced by find_something_to_kill().

◆ pft_fill_utype_parameter()

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

Fill classic parameters for an unit type.

Definition at line 826 of file pf_tools.c.

Referenced by process_attacker_want().