Freeciv-3.2
Loading...
Searching...
No Matches
infracache.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__INFRACACHE_H
14#define FC__INFRACACHE_H
15
16/* server/advisors */
17#include "advtools.h"
18
19struct player;
20
21struct adv_city {
22 /* Used for caching change in value from a worker performing
23 * a particular activity on a particular tile. */
26
27 /* Building desirabilities - easiest to handle them here -- Syela */
28 /* The units of building_want are output
29 * (shields/gold/luxuries) multiplied by a priority
30 * (SHIELD_WEIGHTING, etc or ai->shields_priority, etc)
31 */
33
34 int downtown; /* Distance from neighbors, for locating
35 * wonders wisely */
36};
37
38void adv_city_alloc(struct city *pcity);
39void adv_city_free(struct city *pcity);
40
41void initialize_infrastructure_cache(struct player *pplayer);
42
43void adv_city_update(struct city *pcity);
44
45adv_want city_tile_value(const struct city *pcity, const struct tile *ptile,
46 int foodneed, int prodneed);
47
48void adv_city_worker_act_set(struct city *pcity, int city_tile_index,
49 enum unit_activity act_id, adv_want value);
51 enum unit_activity act_id);
52void adv_city_worker_extra_set(struct city *pcity, int city_tile_index,
53 const struct extra_type *pextra, int value);
54int adv_city_worker_extra_get(const struct city *pcity, int city_tile_index,
55 const struct extra_type *pextra);
57 const struct extra_type *pextra, int value);
58int adv_city_worker_rmextra_get(const struct city *pcity, int city_tile_index,
59 const struct extra_type *pextra);
60
61#endif /* FC__INFRACACHE_H */
char * incite_cost
Definition comments.c:75
float adv_want
Definition fc_types.h:1354
#define B_LAST
Definition improvement.h:42
adv_want adv_city_worker_act_get(const struct city *pcity, int city_tile_index, enum unit_activity act_id)
Definition infracache.c:359
void adv_city_free(struct city *pcity)
Definition infracache.c:501
void adv_city_worker_extra_set(struct city *pcity, int city_tile_index, const struct extra_type *pextra, int value)
Definition infracache.c:377
void adv_city_update(struct city *pcity)
Definition infracache.c:462
void adv_city_worker_act_set(struct city *pcity, int city_tile_index, enum unit_activity act_id, adv_want value)
Definition infracache.c:333
int adv_city_worker_extra_get(const struct city *pcity, int city_tile_index, const struct extra_type *pextra)
Definition infracache.c:429
void initialize_infrastructure_cache(struct player *pplayer)
Definition infracache.c:250
void adv_city_worker_rmextra_set(struct city *pcity, int city_tile_index, const struct extra_type *pextra, int value)
Definition infracache.c:403
int adv_city_worker_rmextra_get(const struct city *pcity, int city_tile_index, const struct extra_type *pextra)
Definition infracache.c:446
void adv_city_alloc(struct city *pcity)
Definition infracache.c:488
adv_want city_tile_value(const struct city *pcity, const struct tile *ptile, int foodneed, int prodneed)
Definition infracache.c:302
int downtown
Definition infracache.h:34
adv_want building_want[B_LAST]
Definition infracache.h:32
int act_cache_radius_sq
Definition infracache.h:25
struct worker_activity_cache * act_cache
Definition infracache.h:24
Definition city.h:320
Definition tile.h:50