37 #define citizens_iterate(_pcity, _pslot, _nationality) \
38 player_slots_iterate(_pslot) \
40 citizens _nationality = citizens_nation_get(_pcity, _pslot); \
41 if (_nationality == 0) { \
44 #define citizens_iterate_end \
46 player_slots_iterate_end;
49 #define citizens_foreign_iterate(_pcity, _pslot, _nationality) \
50 citizens_iterate(_pcity, _pslot, _nationality) \
52 if (_pslot == city_owner(_pcity)->slot) { \
55 #define citizens_foreign_iterate_end \
void citizens_free(struct city *pcity)
Free citizens data.
void citizens_nation_move(struct city *pcity, const struct player_slot *pslot_from, const struct player_slot *pslot_to, int move)
Convert a (positive or negative) value to the citizens from one nation to another.
void citizens_nation_add(struct city *pcity, const struct player_slot *pslot, int add)
Add a (positive or negative) value to the citizens of the given nationality.
citizens citizens_nation_get(const struct city *pcity, const struct player_slot *pslot)
Get the number of citizens with the given nationality.
void citizens_nation_set(struct city *pcity, const struct player_slot *pslot, citizens count)
Set the number of citizens with the given nationality.
citizens citizens_nation_foreign(const struct city *pcity)
Get the number of foreign citizens.
struct player_slot * citizens_random(const struct city *pcity)
Return random citizen from city.
citizens citizens_count(const struct city *pcity)
Return the number of citizens in a city.
void citizens_init(struct city *pcity)
Initialise citizens data.