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
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,
40 struct extra_type **best_target,
41 int completion_time);
42
44 struct unit *punit,
46 struct extra_type **best_target,
47 struct tile **best_tile,
48 struct pf_path **path,
49 struct workermap *state);
50
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
64 struct tile *ptile, struct road_type *proad);
65
67 enum unit_activity activity,
69 struct extra_type *target,
70 const struct tile *ptile);
71
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
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
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 */
#define MAX_NUM_ACTIONS
Definition actions.h:58
void adv_unit_new_task(struct unit *punit, enum adv_unit_task task, struct tile *ptile)
void auto_worker_findwork(const struct civ_map *nmap, struct player *pplayer, struct unit *punit, struct workermap *state, int recursion)
bool adv_worker_safe_tile(const struct civ_map *nmap, const struct player *pplayer, struct unit *punit, struct tile *ptile)
void adv_workers_free(void)
Definition autoworkers.c:86
action_id aw_actions_rmextra[MAX_NUM_ACTIONS]
Definition autoworkers.c:79
adv_want adv_workers_road_bonus(const struct civ_map *nmap, struct tile *ptile, struct road_type *proad)
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)
void auto_workers_player(struct player *pplayer)
struct city * worker_evaluate_city_requests(struct unit *punit, struct worker_task **best_task, struct pf_path **path, struct workermap *state)
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)
action_id aw_actions_extra[MAX_NUM_ACTIONS]
Definition autoworkers.c:78
action_id aw_actions_transform[MAX_NUM_ACTIONS]
Definition autoworkers.c:77
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)
void auto_workers_ruleset_init(void)
Definition autoworkers.c:95
char * incite_cost
Definition comments.c:76
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
float adv_want
Definition fc_types.h:1063
adv_unit_task
Definition fc_types.h:229
int action_id
Definition fc_types.h:248
static int recursion[AIT_LAST]
Definition srv_log.c:45
Definition city.h:317
Definition tile.h:50
Definition unit.h:140