Freeciv-3.3: /fast/freeciv/nightly/main/server/advisors/autoworkers.h Source File

Freeciv-3.3

Loading...
Searching...
No Matches
autoworkers.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__AUTOWORKERS_H
14#define FC__AUTOWORKERS_H
15
16/* common */
17#include "fc_types.h"
18
19void auto_workers_ruleset_init(void);
20
21struct workermap;
22struct pf_path;
23
24void adv_workers_free(void);
25
26void auto_workers_player(struct player *pplayer);
27
28void auto_worker_findwork(const struct civ_map *nmap,
29 struct player *pplayer,
30 struct unit *punit,
31 struct workermap *state,
32 int recursion);
33
34bool auto_worker_setup_work(const struct civ_map *nmap,
35 struct player *pplayer, struct unit *punit,
36 struct workermap *state, int recursion,
37 struct pf_path *path,
38 struct tile *best_tile,
39 enum unit_activity best_act,
40 struct extra_type **best_target,
41 int completion_time);
42
43 adv_want worker_evaluate_improvements(const struct civ_map *nmap,
44 struct unit *punit,
45 enum unit_activity *best_act,
46 struct extra_type **best_target,
47 struct tile **best_tile,
48 struct pf_path **path,
49 struct workermap *state);
50
51struct city *worker_evaluate_city_requests(struct unit *punit,
52 struct worker_task **best_task,
53 struct pf_path **path,
54 struct workermap *state);
55
56void adv_unit_new_task(struct unit *punit, enum adv_unit_task task,
57 struct tile *ptile);
58
59bool adv_worker_safe_tile(const struct civ_map *nmap,
60 const struct player *pplayer, struct unit *punit,
61 struct tile *ptile);
62
63 adv_want adv_workers_road_bonus(const struct civ_map *nmap,
64 struct tile *ptile, struct road_type *proad);
65
66bool auto_workers_speculate_can_act_at(const struct unit *punit,
67 enum unit_activity activity,
68 bool omniscient_cheat,
69 struct extra_type *target,
70 const struct tile *ptile);
71
72extern action_id aw_actions_transform[MAX_NUM_ACTIONS];
73
74#define aw_transform_action_iterate(_act_) \
75{ \
76 action_array_iterate(aw_actions_transform, _act_)
77
78#define aw_transform_action_iterate_end \
79 action_array_iterate_end \
80}
81
82extern action_id aw_actions_extra[MAX_NUM_ACTIONS];
83
84#define aw_extra_action_iterate(_act_) \
85{ \
86 action_array_iterate(aw_actions_extra, _act_)
87
88#define aw_extra_action_iterate_end \
89 action_array_iterate_end \
90}
91
92extern action_id aw_actions_rmextra[MAX_NUM_ACTIONS];
93
94#define aw_rmextra_action_iterate(_act_) \
95{ \
96 action_array_iterate(aw_actions_rmextra, _act_)
97
98#define aw_rmextra_action_iterate_end \
99 action_array_iterate_end \
100}
101
102#endif /* FC__AUTOWORKERS_H */
MAX_NUM_ACTIONS
#define MAX_NUM_ACTIONS
Definition actions.h:58
adv_unit_new_task
void adv_unit_new_task(struct unit *punit, enum adv_unit_task task, struct tile *ptile)
Definition autoworkers.c:1276
auto_worker_findwork
void auto_worker_findwork(const struct civ_map *nmap, struct player *pplayer, struct unit *punit, struct workermap *state, int recursion)
Definition autoworkers.c:926
adv_worker_safe_tile
bool adv_worker_safe_tile(const struct civ_map *nmap, const struct player *pplayer, struct unit *punit, struct tile *ptile)
Definition autoworkers.c:1150
adv_workers_free
void adv_workers_free(void)
Definition autoworkers.c:86
aw_actions_rmextra
action_id aw_actions_rmextra[MAX_NUM_ACTIONS]
Definition autoworkers.c:79
adv_workers_road_bonus
adv_want adv_workers_road_bonus(const struct civ_map *nmap, struct tile *ptile, struct road_type *proad)
Definition autoworkers.c:132
auto_workers_speculate_can_act_at
bool auto_workers_speculate_can_act_at(const struct unit *punit, enum unit_activity activity, bool omniscient_cheat, struct extra_type *target, const struct tile *ptile)
Definition autoworkers.c:1293
auto_workers_player
void auto_workers_player(struct player *pplayer)
Definition autoworkers.c:1172
worker_evaluate_city_requests
struct city * worker_evaluate_city_requests(struct unit *punit, struct worker_task **best_task, struct pf_path **path, struct workermap *state)
Definition autoworkers.c:835
auto_worker_setup_work
bool auto_worker_setup_work(const struct civ_map *nmap, struct player *pplayer, struct unit *punit, struct workermap *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 autoworkers.c:1015
aw_actions_extra
action_id aw_actions_extra[MAX_NUM_ACTIONS]
Definition autoworkers.c:78
aw_actions_transform
action_id aw_actions_transform[MAX_NUM_ACTIONS]
Definition autoworkers.c:77
worker_evaluate_improvements
adv_want worker_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 workermap *state)
Definition autoworkers.c:442
auto_workers_ruleset_init
void auto_workers_ruleset_init(void)
Definition autoworkers.c:95
incite_cost
char * incite_cost
Definition comments.c:74
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
fc_types.h
adv_want
float adv_want
Definition fc_types.h:1335
adv_unit_task
adv_unit_task
Definition fc_types.h:374
action_id
int action_id
Definition fc_types.h:393
recursion
static int recursion[AIT_LAST]
Definition srv_log.c:45
city
Definition city.h:320
civ_map
Definition map_types.h:71
extra_type
Definition extras.h:88
pf_path
Definition path_finding.h:344
player
Definition player.h:249
road_type
Definition road.h:71
tile
Definition tile.h:50
unit
Definition unit.h:140
worker_task
Definition workertask.h:21
workermap
Definition autoworkers.c:72