Freeciv-3.2: /fast/freeciv/nightly/S3_2/common/aicore/pf_tools.h Source File

Freeciv-3.2

Loading...
Searching...
No Matches
pf_tools.h
Go to the documentation of this file.
1/***********************************************************************
2 Freeciv - Copyright (C) 2003 - The Freeciv Project
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation; either version 2, or (at your option)
6 any later version.
7
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
12***********************************************************************/
13#ifndef FC__PF_TOOLS_H
14#define FC__PF_TOOLS_H
15
16#ifdef __cplusplus
17extern "C" {
18#endif /* __cplusplus */
19
20
21/* common/aicore */
22#include "path_finding.h"
23
24/*
25 * Use to create 'amphibious' paths. An amphibious path starts on a sea tile,
26 * perhaps goes over some other sea tiles, then perhaps goes over some land
27 * tiles. This is suitable for a land unit riding on a ferry.
28 * If you want, you can use different call-backs for the land and sea legs,
29 * by changing the 'land' and 'sea' fields.
30 * Initialise the 'land' and 'sea' fields as you like, then initialise the
31 * other fields using using pft_fill_amphibious_parameter().
32 * Give the 'combined' field to pf_create_map to create a map
33 * for finding the path.
34 */
35 struct pft_amphibious
36{
37 /* The caller must initialize these. */
38 struct pf_parameter land, sea;
39
40 /* Initialized in pft_fill_amphibious_parameter; do not touch. */
41 int land_scale, sea_scale;
42 struct pf_parameter combined;
43};
44
45
46void pft_fill_unit_parameter(struct pf_parameter *parameter,
47 const struct civ_map *nmap,
48 const struct unit *punit);
49void pft_fill_unit_overlap_param(struct pf_parameter *parameter,
50 const struct civ_map *nmap,
51 const struct unit *punit);
52void pft_fill_unit_attack_param(struct pf_parameter *parameter,
53 const struct civ_map *nmap,
54 const struct unit *punit);
55
56void pft_fill_utype_parameter(struct pf_parameter *parameter,
57 const struct civ_map *nmap,
58 const struct unit_type *punittype,
59 struct tile *pstart_tile,
60 struct player *pplayer);
61void pft_fill_utype_overlap_param(struct pf_parameter *parameter,
62 const struct civ_map *nmap,
63 const struct unit_type *punittype,
64 struct tile *pstart_tile,
65 struct player *pplayer);
66void pft_fill_utype_attack_param(struct pf_parameter *parameter,
67 const struct civ_map *nmap,
68 const struct unit_type *punittype,
69 struct tile *pstart_tile,
70 struct player *pplayer);
71void pft_fill_reverse_parameter(const struct civ_map *nmap,
72 struct pf_parameter *parameter,
73 struct tile *target_tile);
74
75void pft_fill_amphibious_parameter(struct pft_amphibious *parameter);
76enum tile_behavior no_fights_or_unknown(const struct tile *ptile,
77 enum known_type known,
78 const struct pf_parameter *param);
79enum tile_behavior no_fights(const struct tile *ptile, enum known_type known,
80 const struct pf_parameter *param);
81enum tile_behavior no_intermediate_fights(const struct tile *ptile,
82 enum known_type known,
83 const struct pf_parameter *param);
84
85#ifdef __cplusplus
86}
87#endif /* __cplusplus */
88
89#endif /* FC__PF_TOOLS_H */
incite_cost
char * incite_cost
Definition comments.c:74
target_tile
struct unit struct city struct unit struct tile * target_tile
Definition dialogs_g.h:57
punit
struct unit struct city struct unit struct tile struct extra_type const struct act_prob *act_probs int actor_unit_id struct unit struct unit * punit
Definition dialogs_g.h:74
path_finding.h
tile_behavior
tile_behavior
Definition path_finding.h:308
pft_fill_unit_parameter
void pft_fill_unit_parameter(struct pf_parameter *parameter, const struct civ_map *nmap, const struct unit *punit)
Definition pf_tools.c:840
pft_fill_unit_attack_param
void pft_fill_unit_attack_param(struct pf_parameter *parameter, const struct civ_map *nmap, const struct unit *punit)
Definition pf_tools.c:949
pft_fill_unit_overlap_param
void pft_fill_unit_overlap_param(struct pf_parameter *parameter, const struct civ_map *nmap, const struct unit *punit)
Definition pf_tools.c:891
pft_fill_reverse_parameter
void pft_fill_reverse_parameter(const struct civ_map *nmap, struct pf_parameter *parameter, struct tile *target_tile)
Definition pf_tools.c:960
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)
Definition pf_tools.c:933
no_fights
enum tile_behavior no_fights(const struct tile *ptile, enum known_type known, const struct pf_parameter *param)
Definition pf_tools.c:509
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)
Definition pf_tools.c:876
no_intermediate_fights
enum tile_behavior no_intermediate_fights(const struct tile *ptile, enum known_type known, const struct pf_parameter *param)
Definition pf_tools.c:524
no_fights_or_unknown
enum tile_behavior no_fights_or_unknown(const struct tile *ptile, enum known_type known, const struct pf_parameter *param)
Definition pf_tools.c:493
pft_fill_amphibious_parameter
void pft_fill_amphibious_parameter(struct pft_amphibious *parameter)
Definition pf_tools.c:994
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)
Definition pf_tools.c:826
civ_map
Definition map_types.h:71
pf_parameter
Definition path_finding.h:357
pft_amphibious
Definition pf_tools.h:36
pft_amphibious::land_scale
int land_scale
Definition pf_tools.h:41
pft_amphibious::sea_scale
int sea_scale
Definition pf_tools.h:41
pft_amphibious::combined
struct pf_parameter combined
Definition pf_tools.h:42
pft_amphibious::sea
struct pf_parameter land sea
Definition pf_tools.h:38
player
Definition player.h:247
tile
Definition tile.h:50
unit_type
Definition unittype.h:500
unit
Definition unit.h:138
known_type
known_type
Definition tile.h:35