Freeciv-3.2
|
#include "log.h"
#include "rand.h"
#include "citizens.h"
#include "city.h"
#include "fc_types.h"
#include "game.h"
#include "player.h"
#include "cityturn.h"
#include "sanitycheck.h"
#include "citizenshand.h"
Go to the source code of this file.
Macros | |
#define | LOG_CITIZENS_DEBUG |
#define | log_citizens log_debug |
#define | LOG_OR_ASSERT_CITIZENS |
#define | log_citizens_add(_pcity, _delta, _pplayer) |
Functions | |
struct player * | citizens_unit_nationality (const struct city *pcity, int pop_cost, struct citizens_reduction *pchange) |
void | citizens_reduction_apply (struct city *pcity, const struct citizens_reduction *pchange) |
void | citizens_update (struct city *pcity, struct player *plr) |
void | citizens_print (const struct city *pcity) |
static bool | citizen_convert_check (struct city *pcity) |
void | citizens_convert (struct city *pcity) |
void | citizens_convert_conquest (struct city *pcity) |
Definition at line 39 of file citizenshand.c.
Definition at line 161 of file citizenshand.c.
#define LOG_CITIZENS_DEBUG |
Definition at line 36 of file citizenshand.c.
#define LOG_OR_ASSERT_CITIZENS |
Definition at line 49 of file citizenshand.c.
Return whether citizen should be converted this turn.
Definition at line 328 of file citizenshand.c.
Referenced by citizens_convert().
Convert one (random) foreign citizen to the nationality of the owner.
Definition at line 340 of file citizenshand.c.
Referenced by update_city_activities().
Convert citizens to the nationality of the one conquering the city.
Definition at line 386 of file citizenshand.c.
Referenced by transfer_city().
Print the data about the citizens.
Definition at line 299 of file citizenshand.c.
Referenced by citizens_update().
Applies citizens reduction that may be planned previously in citizens_unit_nationality(). Does not check or change city size. If the nationality has less citizens that are to be removed, just removes as many as possible.
Definition at line 173 of file citizenshand.c.
Referenced by city_build_unit().
struct player * citizens_unit_nationality | ( | const struct city * | pcity, |
int | pop_cost, | ||
struct citizens_reduction * | pchange | ||
) |
Get the nationality of a unit built by the city and optionally the numbers of citizens to go into the unit from different nationalities. pcity must be a real city. The algorithm is the same as in citizens_update().
Definition at line 59 of file citizenshand.c.
Referenced by city_create_unit().
Update the nationality according to the city size. New citiens are added using the nationality of the owner. If the city size is reduced, the citizens are removed first from the foreign citizens.
Definition at line 202 of file citizenshand.c.
Referenced by city_add_unit(), city_reduce_size(), city_refresh_after_city_size_increase(), create_city(), sg_load_player_city_citizens(), and sg_load_player_city_citizens().