Freeciv21
Develop your civilization from humble roots to a global empire
daimilitary.h
Go to the documentation of this file.
1 /*__ ___ ***************************************
2 / \ / \ Copyright (c) 1996-2020 Freeciv21 and Freeciv
3 \_ \ / __/ contributors. This file is part of Freeciv21.
4  _\ \ / /__ Freeciv21 is free software: you can redistribute it
5  \___ \____/ __/ and/or modify it under the terms of the GNU General
6  \_ _/ Public License as published by the Free Software
7  | @ @ \_ Foundation, either version 3 of the License,
8  | or (at your option) any later version.
9  _/ /\ You should have received a copy of the GNU
10  /o) (o/\ \_ General Public License along with Freeciv21.
11  \_____/ / If not, see https://www.gnu.org/licenses/.
12  \____/ ********************************************************/
13 #pragma once
14 
15 // common
16 #include "fc_types.h"
17 #include "unittype.h"
18 
19 /* server/advisors */
20 #include "advchoice.h"
21 
22 /* When an enemy has this or lower number of cities left, try harder
23  to finish him off. */
24 #define FINISH_HIM_CITY_COUNT 5
25 
26 typedef struct unit_list *(player_unit_list_getter)(struct player *pplayer);
27 
28 struct unit_type *dai_choose_defender_versus(struct city *pcity,
29  struct unit *attacker);
31  struct ai_type *ait, struct player *pplayer, struct city *pcity,
32  const struct civ_map *mamap, player_unit_list_getter ul_cb);
33 void dai_assess_danger_player(struct ai_type *ait, struct player *pplayer,
34  const struct civ_map *dmap);
35 int assess_defense_quadratic(struct ai_type *ait, struct city *pcity);
36 int assess_defense_unit(struct ai_type *ait, struct city *pcity,
37  struct unit *punit, bool igwall);
38 int assess_defense(struct ai_type *ait, struct city *pcity);
40  const struct unit_type *punittype);
42  const struct unit_type *punittype);
43 bool dai_process_defender_want(struct ai_type *ait, struct player *pplayer,
44  struct city *pcity, int danger,
45  struct adv_choice *choice);
struct unit_list *() player_unit_list_getter(struct player *pplayer)
Definition: daimilitary.h:26
void dai_assess_danger_player(struct ai_type *ait, struct player *pplayer, const struct civ_map *dmap)
Call assess_danger() for all cities owned by pplayer.
int assess_defense(struct ai_type *ait, struct city *pcity)
Estimate defense strength of city.
struct unit_type * dai_choose_defender_versus(struct city *pcity, struct unit *attacker)
Choose the best unit the city can build to defend against attacker v.
Definition: daimilitary.cpp:72
struct adv_choice * military_advisor_choose_build(struct ai_type *ait, struct player *pplayer, struct city *pcity, const struct civ_map *mamap, player_unit_list_getter ul_cb)
This function selects either a defender or an attacker to be built.
int dai_unit_attack_desirability(struct ai_type *ait, const struct unit_type *punittype)
How much we would want that unit to attack with?
bool dai_process_defender_want(struct ai_type *ait, struct player *pplayer, struct city *pcity, int danger, struct adv_choice *choice)
What would be the best defender for that city? Records the best defender type in choice.
int dai_unit_defence_desirability(struct ai_type *ait, const struct unit_type *punittype)
How much we would want that unit to defend a city? (Do not use this function to find bodyguards for s...
int assess_defense_quadratic(struct ai_type *ait, struct city *pcity)
Need positive feedback in m_a_c_b and bodyguard routines.
int assess_defense_unit(struct ai_type *ait, struct city *pcity, struct unit *punit, bool igwall)
One unit only, mostly for findjob; handling boats correctly.
Definition: ai.h:42
Definition: city.h:291
Definition: player.h:231
Definition: unit.h:134