Freeciv-3.2
Loading...
Searching...
No Matches
Data Structures | Functions
citizenshand.h File Reference

Go to the source code of this file.

Data Structures

struct  citizens_reduction
 

Functions

void citizens_update (struct city *pcity, struct player *plr)
 
void citizens_convert (struct city *pcity)
 
void citizens_convert_conquest (struct city *pcity)
 
struct playercitizens_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_print (const struct city *pcity)
 

Function Documentation

◆ citizens_convert()

void citizens_convert ( struct city pcity)

Convert one (random) foreign citizen to the nationality of the owner.

Definition at line 340 of file citizenshand.c.

Referenced by update_city_activities().

◆ citizens_convert_conquest()

void citizens_convert_conquest ( struct city pcity)

Convert citizens to the nationality of the one conquering the city.

Definition at line 386 of file citizenshand.c.

Referenced by transfer_city().

◆ citizens_print()

void citizens_print ( const struct city pcity)

Print the data about the citizens.

Definition at line 299 of file citizenshand.c.

Referenced by citizens_update().

◆ citizens_reduction_apply()

void citizens_reduction_apply ( struct city pcity,
const struct citizens_reduction pchange 
)

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().

◆ citizens_unit_nationality()

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().

◆ citizens_update()

void citizens_update ( struct city pcity,
struct player plr 
)

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().