257 return dist <= city_radius_sq;
265 const int city_radius_sq,
266 const struct tile *city_center,
282 const struct city *
const pcity,
306 const struct tile *city_center,
329 }
else if (
v1 >
v2) {
368#define CITYLOG_MAX_VAL 9999
404#undef CITYLOG_MAX_VAL
596 log_debug(
"[%2d]: (dx,dy) = (%+2d,%+2d), (x,y) = (%2d,%2d), "
597 "dist = %2d, check = %2d",
i,
666 static char buffer[256];
667 const char *state =
NULL;
671 state =
Q_(
"?wonder:W");
673 state =
Q_(
"?destroyed:D");
675 state =
Q_(
"?built:B");
682 state =
Q_(
"?obsolete:O");
684 state =
Q_(
"?redundant:*");
702 static char buffer[256];
904 const struct city *pcity,
948 const struct city *pcity,
971 const struct city *pcity,
995 const struct city *pcity,
998 switch (target->
kind) {
1014 const struct city *pcity,
1017 switch (target->
kind) {
1032 const struct city *pcity,
1035 switch (target->
kind) {
1059 return max - current;
1118#ifndef FREECIV_NDEBUG
1139 return (pcity->
name !=
NULL) ? pcity->
name :
"City missing a name";
1154 log_warn(
_(
"City name \"%s\" too long"), new_name);
1203 int gold_needed = 0;
1205 if (pcity ==
NULL) {
1215 return MAX(gold_needed, 0);
1224 int gold_needed = 0;
1243 if (
NULL == pimprove) {
1402 const struct city *pcity,
1403 const struct tile *ptile)
1409 if (
NULL == ptile) {
1466 const struct tile *ptile)
1488 const struct tile *ptile,
1561 const struct tile *ptile)
1683 if (pcity->id ==
id) {
1740 const char *
qs =
Qn_(s);
1782#define log_ca_s_init log_debug
1820 ?
"possible" :
"impossible"),
1849 ?
"possible" :
"impossible"),
1862 switch (tgt->
kind) {
1910 switch (target->
kind) {
2022 const struct player *pplayer)
2037 const struct player *pplayer)
2052 const struct player *pplayer)
2067 const struct player *pplayer)
2094 const struct tile *ptile,
2113 const struct tile *ptile,
2139 if (city_size == 0) {
2325 const struct city *pcity,
2326 int *output,
bool *workers_map)
2329#ifdef CITY_DEBUGGING
2338 if (workers_map ==
NULL) {
2348#ifdef CITY_DEBUGGING
2532 *unhappy = (
size -
spes - *content - *angry);
2600 while (
faces > 0 && *angry > 0) {
2605 while (
faces > 0 && *unhappy > 0) {
2674 while (
amt > 0 && *angry > 0) {
2679 while (
amt > 0 && *unhappy > 0) {
2689 while (
amt > 0 && *content > 0) {
2694 while (
amt > 1 && *happy > 0) {
2699 while (
amt > 0 && *happy > 0) {
2722 while (bonus > 0 && *content > 0) {
2727 while (bonus > 1 && *unhappy > 0) {
2735 *content += *unhappy + *angry;
2744 while (bonus > 0 && *angry > 0) {
2749 while (bonus > 0 && *unhappy > 0) {
2814 return MAX(prod +
pop + mod, 0);
2835 float illness_trade = 0.0;
2846 return (
int)illness_trade;
3022 prod =
MAX(prod, 0);
3030 trade =
MAX(trade, 0);
3040 prod =
MAX(prod, 0);
3041 pcity->
prod[
o] = prod;
3062 if (pcity ==
NULL) {
3070 if (happy_cost <= 0) {
3081 if (happy_cost <= 0) {
3177 struct city *pcity,
bool *workers_map)
3179 if (workers_map ==
NULL) {
3255 / (fulltradesize - notradesize);
3335 const struct city *pcity)
3374 log_debug(
"Improvement %s removed from city %s",
3431 struct tile *ptile,
const char *
name)
3444 pcity->
tile = ptile;
3446 pcity->
owner = pplayer;
3505 for (
i = 0;
i <
len;
i++) {
3564 memset(pcity, 0,
sizeof(*pcity));
3647 if (
NULL == pcity) {
3649 log_verbose(
"handle_city_rally_point() bad city number %d.",
3656 log_error(
"city_rally_point_receive() invalid packet length %d (max %d)",
3663 if (packet->
length == 0) {
3675 log_error(
"invalid rally point orders for %s.",
struct action_enabler_list * action_enablers_for_action(action_id action)
#define action_by_result_iterate(_paction_, _result_)
#define action_enabler_list_iterate_end
#define action_by_result_iterate_end
#define action_enabler_list_iterate(action_enabler_list, aenabler)
int ai_type_number(const struct ai_type *ai)
#define CALL_FUNC_EACH_AI(_func,...)
#define BV_ISSET(bv, bit)
void citizens_free(struct city *pcity)
#define citizens_foreign_iterate_end
#define citizens_foreign_iterate(_pcity, _pslot, _nationality)
bool base_city_celebrating(const struct city *pcity)
bool city_is_virtual(const struct city *pcity)
int city_turns_to_build(const struct city *pcity, const struct universal *target, bool include_shield_stock)
static void citizen_luxury_happy(struct city *pcity, int *luxuries)
const char * city_improvement_name_translation(const struct city *pcity, const struct impr_type *pimprove)
static void citizen_content_buildings(struct city *pcity)
bool is_free_worked(const struct city *pcity, const struct tile *ptile)
bool city_production_gets_caravan_shields(const struct universal *tgt)
static bv_imprs caravan_helped_impr
void city_map_radius_sq_set(struct city *pcity, int radius_sq)
int city_production_build_shield_cost(const struct city *pcity)
void city_name_set(struct city *pcity, const char *new_name)
static int player_base_citizen_happiness(const struct player *pplayer)
int city_granary_size(int city_size)
static void get_worked_tile_output(const struct civ_map *nmap, const struct city *pcity, int *output, bool *workers_map)
citizens player_angry_citizens(const struct player *pplayer)
int city_pollution_types(const struct city *pcity, int shield_total, int *pollu_prod, int *pollu_pop, int *pollu_mod)
void city_set_ai_data(struct city *pcity, const struct ai_type *ai, void *data)
static void citizen_happy_wonders(struct city *pcity)
bool is_friendly_city_near(const struct civ_map *nmap, const struct player *owner, const struct tile *ptile, int distance)
bool city_built_last_turn(const struct city *pcity)
void city_choose_build_default(const struct civ_map *nmap, struct city *pcity)
int city_waste(const struct city *pcity, Output_type_id otype, int total, int *breakdown)
static void city_support(const struct civ_map *nmap, struct city *pcity)
void generate_city_map_indices(void)
int city_build_slots(const struct city *pcity)
struct tile * city_map_to_tile(const struct civ_map *nmap, const struct tile *city_center, int city_radius_sq, int city_map_x, int city_map_y)
bool city_has_building(const struct city *pcity, const struct impr_type *pimprove)
const char * city_style_name_translation(const int style)
void city_styles_free(void)
static int city_tile_cache_get_output(const struct city *pcity, int city_tile_index, enum output_type_id o)
Output_type_id output_type_by_identifier(const char *id)
bool is_capital(const struct city *pcity)
void city_styles_alloc(int num)
const char * city_name_get(const struct city *pcity)
bool base_city_can_work_tile(const struct player *restriction, const struct city *pcity, const struct tile *ptile)
int city_unit_slots_available(const struct city *pcity)
void city_production_caravan_shields_init(void)
void city_remove_improvement(struct city *pcity, const struct impr_type *pimprove)
int city_improvement_upkeep(const struct city *pcity, const struct impr_type *b)
int city_airlift_max(const struct city *pcity)
bool citymindist_prevents_city_on_tile(const struct civ_map *nmap, const struct tile *ptile)
bool can_city_build_later(const struct civ_map *nmap, const struct city *pcity, const struct universal *target)
struct output_type * get_output_type(Output_type_id output)
bool is_city_option_set(const struct city *pcity, enum city_options option)
int city_population(const struct city *pcity)
static struct iter_index * city_map_index
const char * city_style_rule_name(const int style)
void city_size_add(struct city *pcity, int add)
bool city_can_use_specialist(const struct city *pcity, Specialist_type_id type)
bool city_production_has_flag(const struct city *pcity, enum impr_flag_id flag)
bool city_is_occupied(const struct city *pcity)
void free_city_map_index(void)
int city_production_unit_veteran_level(struct city *pcity, const struct unit_type *punittype)
void add_tax_income(const struct player *pplayer, int trade, int *output)
bool can_city_build_improvement_now(const struct city *pcity, const struct impr_type *pimprove)
bool city_tile_index_to_xy(int *city_map_x, int *city_map_y, int city_tile_index, int city_radius_sq)
struct city * tile_non_allied_city(const struct tile *ptile, const struct player *pplayer)
int city_unit_unhappiness(const struct civ_map *nmap, struct unit *punit, int *free_unhappy)
bool city_got_defense_effect(const struct city *pcity, const struct unit_type *attacker)
citizens player_content_citizens(const struct player *pplayer)
bool city_map_includes_tile(const struct city *const pcity, const struct tile *map_tile)
static void city_tile_cache_update(const struct civ_map *nmap, struct city *pcity)
int get_city_tithes_bonus(const struct city *pcity)
bool is_unit_near_a_friendly_city(const struct civ_map *nmap, const struct unit *punit, int distance)
void citylog_map_data(enum log_level level, int radius_sq, int *map_data)
static int city_map_numtiles[CITY_MAP_MAX_RADIUS_SQ+1]
bool city_rapture_grow(const struct city *pcity)
int city_production_turns_to_build(const struct city *pcity, bool include_shield_stock)
bool city_unhappy(const struct city *pcity)
Specialist_type_id best_specialist(Output_type_id otype, const struct city *pcity)
struct city * create_city_virtual(struct player *pplayer, struct tile *ptile, const char *name)
void set_city_production(struct city *pcity)
struct city * city_list_find_number(struct city_list *This, int id)
static bv_unit_types caravan_helped_utype
int get_final_city_output_bonus(const struct city *pcity, Output_type_id otype)
bool city_celebrating(const struct city *pcity)
bool city_can_be_built_tile_only(const struct civ_map *nmap, const struct tile *ptile)
bool can_city_build_improvement_direct(const struct city *pcity, const struct impr_type *pimprove)
const char * get_output_identifier(Output_type_id output)
int city_illness_calc(const struct city *pcity, int *ill_base, int *ill_size, int *ill_trade, int *ill_pollution)
const char * get_output_name(Output_type_id output)
bool city_can_grow_to(const struct city *pcity, int pop_size)
int city_change_production_penalty(const struct city *pcity, const struct universal *target)
static int get_city_health(const struct city *pcity)
bool is_valid_city_coords(const int city_radius_sq, const int city_map_x, const int city_map_y)
void city_refresh_from_main_map(const struct civ_map *nmap, struct city *pcity, bool *workers_map)
bool can_city_build_direct(const struct civ_map *nmap, const struct city *pcity, const struct universal *target)
static void set_city_bonuses(struct city *pcity)
static void set_surpluses(struct city *pcity)
static const struct city * nearest_gov_center(const struct city *pcity, int *min_dist) fc__attribute((nonnull(1
bool city_can_be_built_here(const struct civ_map *nmap, const struct tile *ptile, const struct unit *punit, bool hut_test)
int city_pollution(const struct city *pcity, int shield_total)
bool city_happy(const struct city *pcity)
void city_size_set(struct city *pcity, citizens size)
void city_add_improvement(struct city *pcity, const struct impr_type *pimprove)
int city_tile_output_now(const struct city *pcity, const struct tile *ptile, Output_type_id otype)
int city_map_radius_sq_get(const struct city *pcity)
struct city * tile_allied_city(const struct tile *ptile, const struct player *pplayer)
struct city * tile_enemy_city(const struct tile *ptile, const struct player *pplayer)
void citylog_map_workers(enum log_level level, struct city *pcity)
bool city_base_to_city_map(int *city_map_x, int *city_map_y, const struct city *const pcity, const struct tile *map_tile)
void destroy_city_virtual(struct city *pcity)
int rs_max_city_radius_sq(void)
bool city_tile_to_city_map(int *city_map_x, int *city_map_y, const int city_radius_sq, const struct tile *city_center, const struct tile *map_tile)
citizens city_specialists(const struct city *pcity)
static char * citylog_map_line(int y, int city_radius_sq, int *city_map_data)
void city_rally_point_receive(const struct packet_city_rally_point *packet, struct city *pcity)
static int cmp(int v1, int v2)
int city_style_by_translated_name(const char *s)
void add_specialist_output(const struct city *pcity, int *output)
static const struct city struct citystyle * city_styles
void * city_ai_data(const struct city *pcity, const struct ai_type *ai)
struct city * city_list_find_name(struct city_list *This, const char *name)
static void citizen_happiness_nationality(struct city *pcity)
int city_tile_output(const struct city *pcity, const struct tile *ptile, bool is_celebrating, Output_type_id otype)
static int city_map_xy[CITY_MAP_MAX_SIZE][CITY_MAP_MAX_SIZE]
int city_tile_xy_to_index(int city_map_x, int city_map_y, int city_radius_sq)
bool can_city_build_unit_direct(const struct civ_map *nmap, const struct city *pcity, const struct unit_type *punittype)
bool is_gov_center(const struct city *pcity)
bool can_city_build_now(const struct civ_map *nmap, const struct city *pcity, const struct universal *target)
static void citizen_happy_luxury(struct city *pcity)
bool can_city_build_unit_now(const struct civ_map *nmap, const struct city *pcity, const struct unit_type *punittype)
int city_map_tiles(int city_radius_sq)
static void unhappy_city_check(struct city *pcity)
struct city * tile_non_attack_city(const struct tile *ptile, const struct player *pplayer)
bool city_can_work_tile(const struct city *pcity, const struct tile *ptile)
bool city_production_is_genus(const struct city *pcity, enum impr_genus_id genus)
int compare_iter_index(const void *a, const void *b)
bool city_production_build_units(const struct city *pcity, bool add_production, int *num_units)
int city_turns_to_grow(const struct city *pcity)
void city_rally_point_clear(struct city *pcity)
bool can_city_build_improvement_later(const struct city *pcity, const struct impr_type *pimprove)
struct output_type output_types[O_LAST]
bool city_exists_within_max_city_map(const struct civ_map *nmap, const struct tile *ptile, bool may_be_on_center)
bool city_had_recent_plague(const struct city *pcity)
static int get_trade_illness(const struct city *pcity)
bool city_can_change_build(const struct city *pcity)
bool can_city_build_unit_later(const struct civ_map *nmap, const struct city *pcity, const struct unit_type *punittype)
int city_total_unit_gold_upkeep(const struct city *pcity)
int city_style_by_rule_name(const char *s)
static void citizen_base_mood(struct city *pcity)
int city_name_compare(const void *p1, const void *p2)
int city_total_impr_gold_upkeep(const struct city *pcity)
static void citizen_happy_units(struct city *pcity)
static void happy_copy(struct city *pcity, enum citizen_feeling i)
const char * city_production_name_translation(const struct city *pcity)
#define city_list_iterate(citylist, pcity)
#define city_tile(_pcity_)
@ UNHAPPY_PENALTY_ALL_PRODUCTION
@ UNHAPPY_PENALTY_SURPLUS
#define city_tile_iterate_index(_nmap, _radius_sq, _city_tile, _tile, _index)
#define CITY_MAP_MAX_RADIUS_SQ
static citizens city_size_get(const struct city *pcity)
#define CITY_MAP_MAX_SIZE
#define city_tile_iterate_index_end
#define CITY_MAP_CENTER_RADIUS_SQ
#define CITY_MAP_MIN_RADIUS_SQ
#define output_type_iterate(output)
#define CITY_REL2ABS(_coor)
#define city_owner(_pcity_)
static bool is_city_center(const struct city *pcity, const struct tile *ptile)
#define city_list_iterate_end
#define city_tile_iterate(_nmap, _radius_sq, _city_tile, _tile)
#define city_map_iterate_end
#define city_map_iterate(_radius_sq, _index, _x, _y)
#define city_tile_iterate_end
#define city_built_iterate(_pcity, _p)
#define is_free_worked_index(city_tile_index)
#define city_map_tiles_from_city(_pcity)
#define CITY_ABS2REL(_coor)
#define city_built_iterate_end
#define output_type_iterate_end
void cm_init_citymap(void)
struct counter * counter_by_index(int index, enum counter_target target)
int counters_get_city_counters_count(void)
struct unit struct city struct unit struct tile struct extra_type const struct act_prob *act_probs int actor_unit_id struct unit struct unit * punit
struct unit struct city struct unit struct tile struct extra_type const struct act_prob *act_probs int actor_unit_id struct unit struct unit int cost
void distribute(int number, unsigned groups, const unsigned *ratios, int *result)
int get_tile_output_bonus(const struct city *pcity, const struct tile *ptile, const struct output_type *poutput, enum effect_type effect_type)
int get_target_bonus_effects(struct effect_list *plist, const struct req_context *context, const struct player *other_player, enum effect_type effect_type)
int get_city_bonus(const struct city *pcity, enum effect_type effect_type)
int get_city_output_bonus(const struct city *pcity, const struct output_type *poutput, enum effect_type effect_type)
int get_building_bonus(const struct city *pcity, const struct impr_type *building, enum effect_type effect_type)
int get_city_tile_output_bonus(const struct city *pcity, const struct tile *ptile, const struct output_type *poutput, enum effect_type effect_type)
int effect_cumulative_max(enum effect_type type, struct universal *unis, size_t n_unis)
int get_unittype_bonus(const struct player *pplayer, const struct tile *ptile, const struct unit_type *punittype, const struct action *paction, enum effect_type effect_type)
int get_player_bonus(const struct player *pplayer, enum effect_type effect_type)
static bool is_server(void)
#define CITY_MAP_MAX_RADIUS
enum output_type_id Output_type_id
struct city * game_city_by_number(int id)
struct government * government_of_player(const struct player *pplayer)
bool is_building_sellable(const struct impr_type *pimprove)
bool can_player_build_improvement_direct(const struct player *p, const struct impr_type *pimprove)
bool is_improvement_redundant(const struct city *pcity, const struct impr_type *pimprove)
bool can_player_build_improvement_later(const struct player *p, const struct impr_type *pimprove)
void wonder_built(const struct city *pcity, const struct impr_type *pimprove)
bool great_wonder_is_destroyed(const struct impr_type *pimprove)
const char * improvement_rule_name(const struct impr_type *pimprove)
Impr_type_id improvement_index(const struct impr_type *pimprove)
bool is_wonder(const struct impr_type *pimprove)
bool is_great_wonder(const struct impr_type *pimprove)
bool improvement_obsolete(const struct player *pplayer, const struct impr_type *pimprove, const struct city *pcity)
bool improvement_has_flag(const struct impr_type *pimprove, enum impr_flag_id flag)
void wonder_destroyed(const struct city *pcity, const struct impr_type *pimprove)
const char * improvement_name_translation(const struct impr_type *pimprove)
bool great_wonder_is_available(const struct impr_type *pimprove)
#define improvement_iterate_end
#define improvement_iterate(_p)
#define fc_assert_msg(condition, message,...)
#define fc_assert_ret(condition)
#define log_warn(message,...)
#define log_verbose(message,...)
#define fc_assert(condition)
#define fc_assert_ret_val(condition, val)
#define log_do_output_for_level(level)
#define fc_assert_action(condition, action)
#define log_debug(message,...)
#define log_base(level, message,...)
#define log_error(message,...)
struct tile * map_pos_to_tile(const struct civ_map *nmap, int map_x, int map_y)
int map_vector_to_sq_distance(int dx, int dy)
bool same_pos(const struct tile *tile1, const struct tile *tile2)
int real_map_distance(const struct tile *tile0, const struct tile *tile1)
void map_distance_vector(int *dx, int *dy, const struct tile *tile0, const struct tile *tile1)
#define square_iterate(nmap, center_tile, radius, tile_itr)
#define square_iterate_end
#define index_to_map_pos(pmap_x, pmap_y, mindex)
#define fc_calloc(n, esz)
#define fc_realloc(ptr, sz)
bool can_unit_exist_at_tile(const struct civ_map *nmap, const struct unit *punit, const struct tile *ptile)
bool is_native_near_tile(const struct civ_map *nmap, const struct unit_class *uclass, const struct tile *ptile)
static const char * rule_name_get(const struct name_translation *ptrans)
static const char * name_translation_get(const struct name_translation *ptrans)
struct city_list * cities
bool pplayers_at_war(const struct player *pplayer, const struct player *pplayer2)
bool pplayers_allied(const struct player *pplayer, const struct player *pplayer2)
bool pplayers_non_attack(const struct player *pplayer, const struct player *pplayer2)
struct player * player_slot_get_player(const struct player_slot *pslot)
bool gives_shared_tiles(const struct player *me, const struct player *them)
int universal_build_shield_cost(const struct city *pcity, const struct universal *target)
bool are_reqs_active_ranges(const enum req_range min_range, const enum req_range max_range, const struct req_context *context, const struct player *other_player, const struct requirement_vector *reqs, const enum req_problem_type prob_type)
bool are_reqs_active(const struct req_context *context, const struct player *other_player, const struct requirement_vector *reqs, const enum req_problem_type prob_type)
bool req_vec_wants_type(const struct requirement_vector *reqs, enum universals_n kind)
bool does_req_contradicts_reqs(const struct requirement *req, const struct requirement_vector *vec)
enum req_unchanging_status is_req_preventing(const struct req_context *context, const struct player *other_player, const struct requirement *req, enum req_problem_type prob_type)
const char * universal_name_translation(const struct universal *psource, char *buf, size_t bufsz)
#define requirement_vector_iterate_end
#define requirement_vector_iterate(req_vec, preq)
static struct setting settings[]
struct setting_list * level[OLEVELS_NUM]
#define CLIP(lower, current, upper)
struct specialist * specialist_by_number(const Specialist_type_id id)
int get_specialist_output(const struct city *pcity, Specialist_type_id sp, Output_type_id otype)
#define specialist_type_iterate_end
#define specialist_type_iterate(sp)
#define DEFAULT_SPECIALIST
struct worker_task_list * task_reqs
struct tile_cache * tile_cache
enum city_wl_cancel_behavior wlcb
struct built_status built[B_LAST]
int last_turns_shield_surplus
enum capital_type capital
struct unit_list * info_units_present
bv_city_options city_options
citizens unit_happy_upkeep
enum city_acquire_type acquire_t
struct unit_list * info_units_supported
void * ais[FREECIV_AI_MOD_LAST]
struct trade_route_list * routes
struct universal production
struct unit_order * orders
struct city::@16 rally_point
struct unit_list * collecting_info_units_supported
int unhappy_penalty[O_LAST]
int before_change_shields
struct unit_list * collecting_info_units_present
citizens feel[CITIZEN_LAST][FEELING_LAST]
citizens specialists[SP_MAX]
struct city::@17::@19 server
struct cm_parameter * cm_parameter
struct universal changed_from
struct unit_list * units_supported
struct city::@17::@20 client
struct packet_ruleset_control control
struct packet_game_info info
struct government * government_during_revolution
struct requirement_vector reqs
struct unit_order orders[MAX_LEN_ROUTE]
int illness_trade_infection
enum gold_upkeep_style gold_upkeep_style
int granary_food_ini[MAX_GRANARY_INIS]
int illness_pollution_factor
int min_city_center_output[O_LAST]
struct city_list * cities
struct player_economic economic
const struct player * player
struct requirement_vector reqs
int fc_snprintf(char *str, size_t n, const char *format,...)
int fc_strcasecmp(const char *str0, const char *str1)
#define sz_strlcpy(dest, src)
#define sz_strlcat(dest, src)
#define terrain_has_flag(terr, flag)
int tile_roads_output_bonus(const struct tile *ptile, enum output_type_id o)
int tile_roads_output_incr(const struct tile *ptile, enum output_type_id o)
enum known_type tile_get_known(const struct tile *ptile, const struct player *pplayer)
struct city * tile_city(const struct tile *ptile)
static bool tile_resource_is_valid(const struct tile *ptile)
#define tile_worked(_tile)
#define tile_resource(_tile)
#define tile_terrain(_tile)
#define tile_owner(_tile)
bool can_cities_trade(const struct city *pc1, const struct city *pc2)
enum trade_route_type cities_trade_route_type(const struct city *pcity1, const struct city *pcity2)
int trade_base_between_cities(const struct city *pc1, const struct city *pc2)
struct trade_route_settings * trade_route_settings_by_type(enum trade_route_type type)
int trade_from_route(const struct city *pc1, const struct trade_route *route, int base)
#define trade_routes_iterate_end
#define trade_partners_iterate_end
#define trade_routes_iterate(c, proute)
#define trade_partners_iterate(c, p)
const struct unit_type * utype
const struct impr_type * building
struct unit_order * create_unit_orders(const struct civ_map *nmap, int length, const struct unit_order *orders)
bool unit_being_aggressive(const struct civ_map *nmap, const struct unit *punit)
bool is_field_unit(const struct unit *punit)
bool is_martial_law_unit(const struct unit *punit)
void unit_virtual_destroy(struct unit *punit)
struct unit * unit_occupies_tile(const struct tile *ptile, const struct player *pplayer)
#define unit_list_iterate(unitlist, punit)
#define unit_list_iterate_end
struct unit_type * best_role_unit(const struct city *pcity, int role)
const struct unit_type * unit_type_get(const struct unit *punit)
bool can_player_build_unit_direct(const struct player *p, const struct unit_type *punittype, bool consider_reg_impr_req)
int utype_veteran_levels(const struct unit_type *punittype)
bool utype_can_do_act_when_ustate(const struct unit_type *punit_type, const action_id act_id, const enum ustate_prop prop, const bool is_there)
const char * utype_rule_name(const struct unit_type *punittype)
struct unit_type * utype_by_number(const Unit_type_id id)
Unit_type_id utype_index(const struct unit_type *punittype)
int utype_pop_value(const struct unit_type *punittype, const struct city *pcity)
bool can_player_build_unit_later(const struct player *p, const struct unit_type *punittype)
int utype_build_shield_cost(const struct city *pcity, const struct player *pplayer, const struct unit_type *punittype)
bool can_utype_do_act_if_tgt_diplrel(const struct unit_type *punit_type, const action_id act_id, const int prop, const bool is_there)
bool utype_can_do_action(const struct unit_type *putype, const action_id act_id)
int utype_happy_cost(const struct unit_type *ut, const struct player *pplayer)
static bool uclass_has_flag(const struct unit_class *punitclass, enum unit_class_flag_id flag)
static bool utype_has_flag(const struct unit_type *punittype, int flag)
#define unit_type_iterate(_p)
#define unit_type_iterate_end
void worklist_init(struct worklist *pwl)
bool worklist_peek_ith(const struct worklist *pwl, struct universal *prod, int idx)
int worklist_length(const struct worklist *pwl)