Stop sharing requirement_unit_state_ereq().
[freeciv.git] / common / culture.c
blob7946fde0702b1c42bd0583708d15b5922cd442b6
1 /****************************************************************************
2 Freeciv - Copyright (C) 2004 - The Freeciv Team
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.
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 ****************************************************************************/
14 #ifdef HAVE_CONFIG_H
15 #include <fc_config.h>
16 #endif
18 /* common */
19 #include "city.h"
20 #include "effects.h"
21 #include "player.h"
23 #include "culture.h"
25 /****************************************************************************
26 Return current culture score of the city.
27 ****************************************************************************/
28 int city_culture(const struct city *pcity)
30 return pcity->history + get_city_bonus(pcity, EFT_PERFORMANCE);
33 /****************************************************************************
34 How much history city gains this turn.
35 ****************************************************************************/
36 int city_history_gain(const struct city *pcity)
38 return get_city_bonus(pcity, EFT_HISTORY);
41 /****************************************************************************
42 Return current culture score of the player.
43 ****************************************************************************/
44 int player_culture(const struct player *plr)
46 int culture = plr->culture + get_player_bonus(plr, EFT_NATION_PERFORMANCE);
48 city_list_iterate(plr->cities, pcity) {
49 culture += city_culture(pcity);
50 } city_list_iterate_end;
52 return culture;
55 /****************************************************************************
56 How much nation-wide history player gains this turn. Does NOT include
57 history gains of individual cities.
58 ****************************************************************************/
59 int nation_history_gain(const struct player *pplayer)
61 return get_player_bonus(pplayer, EFT_NATION_HISTORY);