Freeciv-3.1: /fast/freeciv/nightly/S3_1/server/advisors/autosettlers.h Source File

Freeciv-3.1

Loading...
Searching...
No Matches
autosettlers.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__AUTOSETTLERS_H
14#define FC__AUTOSETTLERS_H
15
16/* common */
17#include "fc_types.h"
18#include "map.h"
19
20void auto_settlers_ruleset_init(void);
21
22struct settlermap;
23struct pf_path;
24
25void adv_settlers_free(void);
26
27void auto_settlers_player(struct player *pplayer);
28
29void auto_settler_findwork(const struct civ_map *nmap,
30 struct player *pplayer,
31 struct unit *punit,
32 struct settlermap *state,
33 int recursion);
34
35bool auto_settler_setup_work(const struct civ_map *nmap,
36 struct player *pplayer, struct unit *punit,
37 struct settlermap *state, int recursion,
38 struct pf_path *path,
39 struct tile *best_tile,
40 enum unit_activity best_act,
41 struct extra_type **best_target,
42 int completion_time);
43
44 adv_want settler_evaluate_improvements(const struct civ_map *nmap,
45 struct unit *punit,
46 enum unit_activity *best_act,
47 struct extra_type **best_target,
48 struct tile **best_tile,
49 struct pf_path **path,
50 struct settlermap *state);
51
52struct city *settler_evaluate_city_requests(struct unit *punit,
53 struct worker_task **best_task,
54 struct pf_path **path,
55 struct settlermap *state);
56
57void adv_unit_new_task(struct unit *punit, enum adv_unit_task task,
58 struct tile *ptile);
59
60bool adv_settler_safe_tile(const struct civ_map *nmap,
61 const struct player *pplayer, struct unit *punit,
62 struct tile *ptile);
63
64 adv_want adv_settlers_road_bonus(const struct civ_map *nmap,
65 struct tile *ptile, struct road_type *proad);
66
67bool auto_settlers_speculate_can_act_at(const struct unit *punit,
68 enum unit_activity activity,
69 bool omniscient_cheat,
70 struct extra_type *target,
71 const struct tile *ptile);
72
73extern action_id as_actions_transform[MAX_NUM_ACTIONS];
74
75#define as_transform_action_iterate(_act_) \
76{ \
77 action_array_iterate(as_actions_transform, _act_)
78
79#define as_transform_action_iterate_end \
80 action_array_iterate_end \
81}
82
83extern action_id as_actions_extra[MAX_NUM_ACTIONS];
84
85#define as_extra_action_iterate(_act_) \
86{ \
87 action_array_iterate(as_actions_extra, _act_)
88
89#define as_extra_action_iterate_end \
90 action_array_iterate_end \
91}
92
93extern action_id as_actions_rmextra[MAX_NUM_ACTIONS];
94
95#define as_rmextra_action_iterate(_act_) \
96{ \
97 action_array_iterate(as_actions_rmextra, _act_)
98
99#define as_rmextra_action_iterate_end \
100 action_array_iterate_end \
101}
102
103#endif /* FC__AUTOSETTLERS_H */
MAX_NUM_ACTIONS
#define MAX_NUM_ACTIONS
Definition actions.h:296
as_actions_rmextra
action_id as_actions_rmextra[MAX_NUM_ACTIONS]
Definition autosettlers.c:78
adv_unit_new_task
void adv_unit_new_task(struct unit *punit, enum adv_unit_task task, struct tile *ptile)
Definition autosettlers.c:1267
as_actions_transform
action_id as_actions_transform[MAX_NUM_ACTIONS]
Definition autosettlers.c:76
auto_settler_setup_work
bool auto_settler_setup_work(const struct civ_map *nmap, struct player *pplayer, struct unit *punit, struct settlermap *state, int recursion, struct pf_path *path, struct tile *best_tile, enum unit_activity best_act, struct extra_type **best_target, int completion_time)
Definition autosettlers.c:1010
auto_settlers_ruleset_init
void auto_settlers_ruleset_init(void)
Definition autosettlers.c:94
settler_evaluate_city_requests
struct city * settler_evaluate_city_requests(struct unit *punit, struct worker_task **best_task, struct pf_path **path, struct settlermap *state)
Definition autosettlers.c:830
settler_evaluate_improvements
adv_want settler_evaluate_improvements(const struct civ_map *nmap, struct unit *punit, enum unit_activity *best_act, struct extra_type **best_target, struct tile **best_tile, struct pf_path **path, struct settlermap *state)
Definition autosettlers.c:442
auto_settlers_player
void auto_settlers_player(struct player *pplayer)
Definition autosettlers.c:1164
as_actions_extra
action_id as_actions_extra[MAX_NUM_ACTIONS]
Definition autosettlers.c:77
adv_settlers_road_bonus
adv_want adv_settlers_road_bonus(const struct civ_map *nmap, struct tile *ptile, struct road_type *proad)
Definition autosettlers.c:133
adv_settler_safe_tile
bool adv_settler_safe_tile(const struct civ_map *nmap, const struct player *pplayer, struct unit *punit, struct tile *ptile)
Definition autosettlers.c:1142
adv_settlers_free
void adv_settlers_free(void)
Definition autosettlers.c:85
auto_settlers_speculate_can_act_at
bool auto_settlers_speculate_can_act_at(const struct unit *punit, enum unit_activity activity, bool omniscient_cheat, struct extra_type *target, const struct tile *ptile)
Definition autosettlers.c:1284
auto_settler_findwork
void auto_settler_findwork(const struct civ_map *nmap, struct player *pplayer, struct unit *punit, struct settlermap *state, int recursion)
Definition autosettlers.c:921
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:73
fc_types.h
adv_want
float adv_want
Definition fc_types.h:1206
adv_unit_task
adv_unit_task
Definition fc_types.h:340
action_id
int action_id
Definition fc_types.h:359
map.h
recursion
static int recursion[AIT_LAST]
Definition srv_log.c:44
city
Definition city.h:309
civ_map
Definition map_types.h:71
extra_type
Definition extras.h:85
pf_path
Definition path_finding.h:344
player
Definition player.h:249
road_type
Definition road.h:75
settlermap
Definition autosettlers.c:71
tile
Definition tile.h:49
unit
Definition unit.h:138
worker_task
Definition workertask.h:21