Freeciv-3.3: /fast/freeciv/nightly/main/ai/default/daitools.h Source File

Freeciv-3.3

Loading...
Searching...
No Matches
daitools.h
Go to the documentation of this file.
1/***********************************************************************
2 Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
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__DAITOOLS_H
14#define FC__DAITOOLS_H
15
16/* utility */
17#include "support.h" /* bool type */
18
19/* server/advisors */
20#include "advchoice.h"
21
22/* ai/default */
23#include "daiunit.h" /* enum ai_unit_task */
24
25struct pf_path;
26struct pf_parameter;
27struct pft_amphibious;
28
29struct adv_risk_cost;
30
31#define DAI_WANT_BELOW_MIL_EMERGENCY (1000.0)
32#define DAI_WANT_MILITARY_EMERGENCY (DAI_WANT_BELOW_MIL_EMERGENCY + 0.1)
33#define DAI_WANT_DOMESTIC_MAX (DAI_WANT_MILITARY_EMERGENCY / 4 * 3)
34
35const char *dai_unit_task_rule_name(const enum ai_unit_task task);
36
37 adv_want military_amortize(struct player *pplayer, struct city *pcity,
38 adv_want value, int delay, int build_cost);
39int stack_cost(struct unit *pattacker, struct unit *pdefender);
40
41void dai_unit_move_or_attack(struct ai_type *ait, struct unit *punit,
42 struct tile *ptile, struct pf_path *path,
43 int step);
44
45void dai_fill_unit_param(struct ai_type *ait,
46 struct pf_parameter *parameter,
47 struct adv_risk_cost *risk_cost,
48 struct unit *punit, struct tile *ptile);
49bool dai_gothere(struct ai_type *ait, struct player *pplayer,
50 struct unit *punit, struct tile *dst_tile);
51struct tile *immediate_destination(struct unit *punit,
52 struct tile *dest_tile);
53void dai_log_path(struct unit *punit,
54 struct pf_path *path, struct pf_parameter *parameter);
55bool dai_unit_goto_constrained(struct ai_type *ait, struct unit *punit,
56 struct tile *ptile,
57 struct pf_parameter *parameter);
58bool dai_unit_goto(struct ai_type *ait, struct unit *punit, struct tile *ptile);
59bool goto_is_sane(struct unit *punit, struct tile *ptile);
60
61void dai_unit_new_task(struct ai_type *ait, struct unit *punit,
62 enum ai_unit_task task, struct tile *ptile);
63void dai_unit_new_adv_task(struct ai_type *ait, struct unit *punit,
64 enum adv_unit_task task, struct tile *ptile);
65bool dai_unit_make_homecity(struct unit *punit, struct city *pcity);
66bool dai_unit_attack(struct ai_type *ait, struct unit *punit,
67 struct tile *ptile);
68bool dai_unit_move(struct ai_type *ait, struct unit *punit, struct tile *ptile);
69
70void dai_government_change(struct player *pplayer, struct government *gov);
71int dai_gold_reserve(struct player *pplayer);
72
73void adjust_choice(int pct, struct adv_choice *choice);
74
75bool dai_choose_role_unit(struct ai_type *ait, struct player *pplayer,
76 struct city *pcity, struct adv_choice *choice,
77 enum choice_type type, int role, int want,
78 bool need_boat);
79void dai_build_adv_override(struct ai_type *ait, struct city *pcity,
80 struct adv_choice *choice);
81bool dai_assess_military_unhappiness(struct city *pcity);
82
83void dai_consider_plr_dangerous(struct ai_type *ait, struct player *plr1,
84 struct player *plr2,
85 enum override_bool *result);
86
87#endif /* FC__DAITOOLS_H */
advchoice.h
choice_type
choice_type
Definition advchoice.h:36
incite_cost
char * incite_cost
Definition comments.c:74
dai_government_change
void dai_government_change(struct player *pplayer, struct government *gov)
Definition daitools.c:1305
dai_fill_unit_param
void dai_fill_unit_param(struct ai_type *ait, struct pf_parameter *parameter, struct adv_risk_cost *risk_cost, struct unit *punit, struct tile *ptile)
Definition daitools.c:467
stack_cost
int stack_cost(struct unit *pattacker, struct unit *pdefender)
Definition daitools.c:1279
dai_gothere
bool dai_gothere(struct ai_type *ait, struct player *pplayer, struct unit *punit, struct tile *dst_tile)
Definition daitools.c:242
goto_is_sane
bool goto_is_sane(struct unit *punit, struct tile *ptile)
Definition daitools.c:427
dai_assess_military_unhappiness
bool dai_assess_military_unhappiness(struct city *pcity)
Definition daitools.c:1414
immediate_destination
struct tile * immediate_destination(struct unit *punit, struct tile *dest_tile)
Definition daitools.c:300
dai_build_adv_override
void dai_build_adv_override(struct ai_type *ait, struct city *pcity, struct adv_choice *choice)
Definition daitools.c:1366
dai_unit_attack
bool dai_unit_attack(struct ai_type *ait, struct unit *punit, struct tile *ptile)
Definition daitools.c:815
dai_unit_goto
bool dai_unit_goto(struct ai_type *ait, struct unit *punit, struct tile *ptile)
Definition daitools.c:603
dai_unit_goto_constrained
bool dai_unit_goto_constrained(struct ai_type *ait, struct unit *punit, struct tile *ptile, struct pf_parameter *parameter)
Definition daitools.c:376
dai_log_path
void dai_log_path(struct unit *punit, struct pf_path *path, struct pf_parameter *parameter)
Definition daitools.c:354
dai_consider_plr_dangerous
void dai_consider_plr_dangerous(struct ai_type *ait, struct player *plr1, struct player *plr2, enum override_bool *result)
Definition daitools.c:141
dai_unit_new_task
void dai_unit_new_task(struct ai_type *ait, struct unit *punit, enum ai_unit_task task, struct tile *ptile)
Definition daitools.c:641
dai_gold_reserve
int dai_gold_reserve(struct player *pplayer)
Definition daitools.c:1324
adjust_choice
void adjust_choice(int pct, struct adv_choice *choice)
Definition daitools.c:1334
dai_unit_make_homecity
bool dai_unit_make_homecity(struct unit *punit, struct city *pcity)
Definition daitools.c:753
dai_choose_role_unit
bool dai_choose_role_unit(struct ai_type *ait, struct player *pplayer, struct city *pcity, struct adv_choice *choice, enum choice_type type, int role, int want, bool need_boat)
Definition daitools.c:1343
dai_unit_task_rule_name
const char * dai_unit_task_rule_name(const enum ai_unit_task task)
Definition daitools.c:76
military_amortize
adv_want military_amortize(struct player *pplayer, struct city *pcity, adv_want value, int delay, int build_cost)
Definition daitools.c:117
dai_unit_move
bool dai_unit_move(struct ai_type *ait, struct unit *punit, struct tile *ptile)
Definition daitools.c:1082
dai_unit_new_adv_task
void dai_unit_new_adv_task(struct ai_type *ait, struct unit *punit, enum adv_unit_task task, struct tile *ptile)
Definition daitools.c:617
dai_unit_move_or_attack
void dai_unit_move_or_attack(struct ai_type *ait, struct unit *punit, struct tile *ptile, struct pf_path *path, int step)
Definition daitools.c:1064
daiunit.h
ai_unit_task
ai_unit_task
Definition daiunit.h:27
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
adv_want
float adv_want
Definition fc_types.h:1365
adv_unit_task
adv_unit_task
Definition fc_types.h:374
override_bool
override_bool
Definition fc_types.h:94
type
GType type
Definition repodlgs.c:1313
step
int step
Definition specpq.h:92
adv_choice
Definition advchoice.h:45
adv_risk_cost
Definition advgoto.h:26
ai_type
Definition ai.h:50
city
Definition city.h:320
government
Definition government.h:52
pf_parameter
Definition path_finding.h:357
pf_path
Definition path_finding.h:344
pft_amphibious
Definition pf_tools.h:36
player
Definition player.h:249
tile
Definition tile.h:50
unit
Definition unit.h:140
support.h