Freeciv21
Develop your civilization from humble roots to a global empire
cityturn.h
Go to the documentation of this file.
1 /**************************************************************************
2  Copyright (c) 1996-2020 Freeciv21 and Freeciv contributors. This file is
3  __ __ part of Freeciv21. Freeciv21 is free software: you can
4 / \\..// \ redistribute it and/or modify it under the terms of the GNU
5  ( oo ) General Public License as published by the Free Software
6  \__/ Foundation, either version 3 of the License, or (at your
7  option) any later version. You should have received
8  a copy of the GNU General Public License along with Freeciv21. If not,
9  see https://www.gnu.org/licenses/.
10 **************************************************************************/
11 
12 #pragma once
13 
14 #include "support.h" // bool type
15 
16 #include "fc_types.h"
17 
18 struct conn_list;
19 struct cm_result;
20 
21 bool city_refresh(struct city *pcity); // call if city has changed
22 void city_refresh_for_player(struct player *pplayer); /* tax/govt changed */
23 
24 void city_refresh_queue_add(struct city *pcity);
26 
27 void auto_arrange_workers(struct city *pcity); // will arrange the workers
28 void apply_cmresult_to_city(struct city *pcity,
29  const std::unique_ptr<cm_result> &cmr);
30 
31 bool city_change_size(struct city *pcity, citizens new_size,
32  struct player *nationality, const char *reason);
33 bool city_reduce_size(struct city *pcity, citizens pop_loss,
34  struct player *destroyer, const char *reason);
35 void city_repair_size(struct city *pcity, int change);
36 
37 bool city_empty_food_stock(struct city *pcity);
38 
39 void send_city_turn_notifications(struct connection *pconn);
40 void update_city_activities(struct player *pplayer);
41 int city_incite_cost(struct player *pplayer, struct city *pcity);
42 void remove_obsolete_buildings_city(struct city *pcity, bool refresh);
43 void remove_obsolete_buildings(struct player *pplayer);
44 
45 void choose_build_target(struct player *pplayer, struct city *pcity);
46 
47 void nullify_prechange_production(struct city *pcity);
48 
50 
51 void check_disasters();
52 
53 void city_style_refresh(struct city *pcity);
void remove_obsolete_buildings(struct player *pplayer)
Sell obsolete buildings from all cities of the player.
Definition: cityturn.cpp:263
bool city_change_size(struct city *pcity, citizens new_size, struct player *nationality, const char *reason)
Change the city size.
Definition: cityturn.cpp:1067
void choose_build_target(struct player *pplayer, struct city *pcity)
Assuming we just finished building something, find something new to build.
Definition: cityturn.cpp:2089
void auto_arrange_workers(struct city *pcity)
Call sync_cities() to send the affected cities to the clients.
Definition: cityturn.cpp:359
void city_refresh_queue_add(struct city *pcity)
Queue pending city_refresh() for later.
Definition: cityturn.cpp:188
void nullify_prechange_production(struct city *pcity)
Initialize all variables containing information about production before it was changed.
Definition: cityturn.cpp:3254
bool city_empty_food_stock(struct city *pcity)
Returns TRUE iff the city's food stock was emptied.
Definition: cityturn.cpp:3988
bool check_city_migrations()
Check for citizens who want to migrate between the cities that overlap.
Definition: cityturn.cpp:3954
void apply_cmresult_to_city(struct city *pcity, const std::unique_ptr< cm_result > &cmr)
Rearrange workers according to a cm_result struct.
Definition: cityturn.cpp:276
void city_refresh_queue_processing()
Refresh the listed cities.
Definition: cityturn.cpp:204
void city_repair_size(struct city *pcity, int change)
Repair the city population without affecting city size.
Definition: cityturn.cpp:895
void send_city_turn_notifications(struct connection *pconn)
Send global and player specific city turn notifications.
Definition: cityturn.cpp:548
int city_incite_cost(struct player *pplayer, struct city *pcity)
Returns the cost to incite a city.
Definition: cityturn.cpp:3135
void update_city_activities(struct player *pplayer)
Update all cities of one nation (costs for buildings, unit upkeep, ...).
Definition: cityturn.cpp:589
bool city_reduce_size(struct city *pcity, citizens pop_loss, struct player *destroyer, const char *reason)
Reduce the city size.
Definition: cityturn.cpp:815
bool city_refresh(struct city *pcity)
Updates unit upkeeps and city internal cached data.
Definition: cityturn.cpp:147
void check_disasters()
Check for any disasters hitting any city, and apply those disasters.
Definition: cityturn.cpp:4117
void city_style_refresh(struct city *pcity)
Recheck and store style of the city.
Definition: cityturn.cpp:4328
void city_refresh_for_player(struct player *pplayer)
Called on government change or wonder completion or stuff like that – Syela.
Definition: cityturn.cpp:171
void remove_obsolete_buildings_city(struct city *pcity, bool refresh)
Automatically sells obsolete buildings from city.
Definition: cityturn.cpp:228
unsigned char citizens
Definition: fc_types.h:305
Definition: city.h:291
Definition: cm.h:35
Definition: player.h:231