36#define LOG_CITIZENS_DEBUG
38#ifdef LOG_CITIZENS_DEBUG
39#define log_citizens log_debug
44#define log_citizens log_verbose
48#if !defined(FREECIV_NDEBUG) || defined(LOG_CITIZENS)
49#define LOG_OR_ASSERT_CITIZENS
88 while (count > 0 && pop_cost > 0) {
103 if (nationality == 1) {
107 if (selected != --count) {
111 diff =
MIN(pop_cost, nationality / 2);
121 if (nationality > 1) {
161#define log_citizens_add(_pcity, _delta, _pplayer) \
162 log_citizens("%s (size %d; %s): %+d citizen(s) for %s (now: %d)", \
163 city_name_get(_pcity), city_size_get(_pcity), \
164 player_name(city_owner(_pcity)), _delta, \
165 player_name(_pplayer), \
166 citizens_nation_get(_pcity, _pplayer->slot));
250 while (count > 0 && delta < 0) {
254#ifdef LOG_OR_ASSERT_CITIZENS
261 if (nationality == 1) {
272 int diff =
MAX(delta, - nationality / 2);
294#undef log_citizens_add
311#ifdef LOG_OR_ASSERT_CITIZENS
362 if (nationality != 0) {
370#ifdef LOG_OR_ASSERT_CITIZENS
376 log_citizens(
"%s (size %d; %s): convert 1 citizen from %s",
402#ifdef LOG_OR_ASSERT_CITIZENS
408 log_citizens(
"%s (size %d; %s): convert %d citizen from %s (conquered)",
void citizens_nation_move(struct city *pcity, const struct player_slot *pslot_from, const struct player_slot *pslot_to, int move)
void citizens_nation_add(struct city *pcity, const struct player_slot *pslot, int add)
citizens citizens_nation_get(const struct city *pcity, const struct player_slot *pslot)
void citizens_nation_set(struct city *pcity, const struct player_slot *pslot, citizens count)
citizens citizens_nation_foreign(const struct city *pcity)
citizens citizens_count(const struct city *pcity)
#define citizens_foreign_iterate_end
#define citizens_foreign_iterate(_pcity, _pslot, _nationality)
#define citizens_iterate_end
#define citizens_iterate(_pcity, _pslot, _nationality)
struct player * citizens_unit_nationality(const struct city *pcity, int pop_cost, struct citizens_reduction *pchange)
void citizens_convert_conquest(struct city *pcity)
void citizens_reduction_apply(struct city *pcity, const struct citizens_reduction *pchange)
void citizens_convert(struct city *pcity)
#define log_citizens_add(_pcity, _delta, _pplayer)
static bool citizen_convert_check(struct city *pcity)
void citizens_update(struct city *pcity, struct player *plr)
void citizens_print(const struct city *pcity)
const char * city_name_get(const struct city *pcity)
static citizens city_size_get(const struct city *pcity)
#define city_owner(_pcity_)
#define MAX_CITY_NATIONALITIES
#define MAX_NUM_PLAYER_SLOTS
#define fc_assert_ret(condition)
#define fc_assert(condition)
#define fc_assert_ret_val(condition, val)
const char * player_name(const struct player *pplayer)
struct player * player_slot_get_player(const struct player_slot *pslot)
struct city::@17::@19 server
struct packet_game_info info
int citizen_convert_speed
struct player_slot * slot