Freeciv-3.2: /fast/freeciv/nightly/S3_2/server/advisors/infracache.h Source File

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
21 struct adv_city {
22 /* Used for caching change in value from a worker performing
23 * a particular activity on a particular tile. */
24 struct worker_activity_cache *act_cache;
25 int act_cache_radius_sq;
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 */
32 adv_want building_want[B_LAST];
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
45 adv_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);
50 adv_want adv_city_worker_act_get(const struct city *pcity, int city_tile_index,
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);
56void adv_city_worker_rmextra_set(struct city *pcity, int city_tile_index,
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 */
advtools.h
incite_cost
char * incite_cost
Definition comments.c:74
adv_want
float adv_want
Definition fc_types.h:1355
B_LAST
#define B_LAST
Definition improvement.h:42
adv_city_worker_act_get
adv_want adv_city_worker_act_get(const struct city *pcity, int city_tile_index, enum unit_activity act_id)
Definition infracache.c:359
adv_city_free
void adv_city_free(struct city *pcity)
Definition infracache.c:501
adv_city_worker_extra_set
void adv_city_worker_extra_set(struct city *pcity, int city_tile_index, const struct extra_type *pextra, int value)
Definition infracache.c:377
adv_city_update
void adv_city_update(struct city *pcity)
Definition infracache.c:462
adv_city_worker_act_set
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
adv_city_worker_extra_get
int adv_city_worker_extra_get(const struct city *pcity, int city_tile_index, const struct extra_type *pextra)
Definition infracache.c:429
initialize_infrastructure_cache
void initialize_infrastructure_cache(struct player *pplayer)
Definition infracache.c:250
adv_city_worker_rmextra_set
void adv_city_worker_rmextra_set(struct city *pcity, int city_tile_index, const struct extra_type *pextra, int value)
Definition infracache.c:403
adv_city_worker_rmextra_get
int adv_city_worker_rmextra_get(const struct city *pcity, int city_tile_index, const struct extra_type *pextra)
Definition infracache.c:446
adv_city_alloc
void adv_city_alloc(struct city *pcity)
Definition infracache.c:488
city_tile_value
adv_want city_tile_value(const struct city *pcity, const struct tile *ptile, int foodneed, int prodneed)
Definition infracache.c:302
adv_city
Definition infracache.h:21
adv_city::downtown
int downtown
Definition infracache.h:34
adv_city::building_want
adv_want building_want[B_LAST]
Definition infracache.h:32
adv_city::act_cache_radius_sq
int act_cache_radius_sq
Definition infracache.h:25
adv_city::act_cache
struct worker_activity_cache * act_cache
Definition infracache.h:24
city
Definition city.h:320
extra_type
Definition extras.h:88
player
Definition player.h:247
tile
Definition tile.h:50
worker_activity_cache
Definition infracache.c:35