111 :
Q_(
"?city_state:Peace"))));
271 int attack_best[4] = {-1, -1, -1, -1}, i;
279 for (i = 2; i >= 0 && attack_best[i] < attack_best[i + 1]; i--) {
280 int tmp = attack_best[i];
281 attack_best[i] = attack_best[i + 1];
282 attack_best[i + 1] = tmp;
287 for (i = 0; i < 3; i++) {
288 if (attack_best[i] >= 0) {
289 cat_snprintf(buf,
sizeof(buf),
"%s%d", (i > 0) ?
"/" :
"",
292 cat_snprintf(buf,
sizeof(buf),
"%s-", (i > 0) ?
"/" :
"");
308 int defense_best[4] = {-1, -1, -1, -1}, i;
316 for (i = 2; i >= 0 && defense_best[i] < defense_best[i + 1]; i--) {
317 int tmp = defense_best[i];
319 defense_best[i] = defense_best[i + 1];
320 defense_best[i + 1] = tmp;
325 for (i = 0; i < 3; i++) {
326 if (defense_best[i] >= 0) {
327 cat_snprintf(buf,
sizeof(buf),
"%s%d", (i > 0) ?
"/" :
"",
330 cat_snprintf(buf,
sizeof(buf),
"%s-", (i > 0) ?
"/" :
"");
348 fc_snprintf(buf,
sizeof(buf),
"%2d", num_supported);
362 int num_present = unit_list_size(pcity->
tile->
units);
531 int num = 0, value = 0;
535 value += proute->value;
541 fc_snprintf(buf,
sizeof(buf),
"%d (+%d)", num, value);
567 static char buf[192];
568 const char *from_worklist =
618 fc_snprintf(buf,
sizeof(buf),
"%s/%s", buftwo, bufone);
695#define FUNC_TAG(var) cr_entry_##var, #var
698 {
TRUE, -15, NULL,
N_(
"?city:Name"),
N_(
"City Name"),
700 {
FALSE, -15, NULL,
N_(
"Nation"),
N_(
"Nation"),
702 {
TRUE, 2, NULL,
N_(
"?size [short]:Sz"),
N_(
"Size"),
704 {
TRUE, -8, NULL,
N_(
"State"),
N_(
"Celebrating/Peace/Disorder"),
706 {
FALSE, 1, NULL, NULL,
N_(
"Concise *=Celebrating, X=Disorder"),
709 {
FALSE, 2, NULL,
N_(
"?Happy workers:H"),
N_(
"Workers: Happy"),
711 {
FALSE, 2, NULL,
N_(
"?Content workers:C"),
N_(
"Workers: Content"),
713 {
FALSE, 2, NULL,
N_(
"?Unhappy workers:U"),
N_(
"Workers: Unhappy"),
715 {
FALSE, 2, NULL,
N_(
"?Angry workers:A"),
N_(
"Workers: Angry"),
717 {
TRUE, 10,
N_(
"?city:Workers"),
718 N_(
"?happy/content/unhappy/angry:H/C/U/A"),
719 N_(
"Workers: Happy, Content, Unhappy, Angry"),
725 N_(
"Best defending units"), NULL,
FUNC_TAG(defense)},
728 N_(
"?Present (units):Here"),
729 N_(
"Number of units present"), NULL,
FUNC_TAG(present) },
732 N_(
"?Supported (units):Owned"),
733 N_(
"Number of units supported"), NULL,
FUNC_TAG(supported) },
736 TRUE, 14,
N_(
"?food (population):Grow"),
737 N_(
"?Stock/Target:(Have/Need)"),
738 N_(
"Turns until growth/famine"),
741 {
TRUE, 10,
N_(
"Surplus"),
N_(
"?food/production/trade:F/P/T"),
742 N_(
"Surplus: Food, Production, Trade"),
744 {
FALSE, 3, NULL,
N_(
"?Food surplus [short]:+F"),
N_(
"Surplus: Food"),
746 {
FALSE, 3, NULL,
N_(
"?Production surplus [short]:+P"),
747 N_(
"Surplus: Production"), NULL,
FUNC_TAG(prodplus) },
748 {
FALSE, 3, NULL,
N_(
"?Production loss (waste) [short]:-P"),
750 {
FALSE, 3, NULL,
N_(
"?Trade surplus [short]:+T"),
N_(
"Surplus: Trade"),
752 {
FALSE, 3, NULL,
N_(
"?Trade loss (corruption) [short]:-T"),
753 N_(
"Corruption"), NULL,
FUNC_TAG(corruption) },
755 {
TRUE, 10,
N_(
"Economy"),
N_(
"?gold/luxury/science:G/L/S"),
756 N_(
"Economy: Gold, Luxuries, Science"),
758 {
FALSE, 3, NULL,
N_(
"?Gold:G"),
N_(
"Economy: Gold"),
760 {
FALSE, 3, NULL,
N_(
"?Luxury:L"),
N_(
"Economy: Luxury"),
762 {
FALSE, 3, NULL,
N_(
"?Science:S"),
N_(
"Economy: Science"),
764 {
FALSE, 3, NULL,
N_(
"?Culture:Clt"),
N_(
"Culture (History+Performance)"),
766 {
FALSE, 3, NULL,
N_(
"?History:Hst"),
767 N_(
"Culture: History (and gain per turn)"),
769 {
FALSE, 3, NULL,
N_(
"?Performance:Prf"),
N_(
"Culture: Performance"),
771 {
FALSE, 3, NULL,
N_(
"?Continent:C"),
N_(
"Continent number"),
773 {
FALSE, 1,
N_(
"?number_trade_routes:n"),
774 N_(
"?number_trade_routes:R"),
775 N_(
"Number (and total value) of trade routes"),
777 {
FALSE, 3, NULL,
N_(
"?pollution [short]:Pol"),
N_(
"?stats:Pollution"),
779 {
FALSE, 4,
N_(
"?plague risk [short]:Pla"),
N_(
"(%)"),
780 N_(
"Plague risk per turn"),
782 {
FALSE, 15, NULL,
N_(
"?cma:Governor"),
N_(
"Citizen Governor"),
786 {
FALSE, 3, NULL,
N_(
"BS"),
N_(
"Maximum units buildable per turn"),
788 {
TRUE, 9,
N_(
"Production"),
N_(
"Turns/Buy"),
792 {
TRUE, 0,
N_(
"Currently Building"),
793 N_(
"?Stock/Target:(Have/Need)"),
794 N_(
"Currently Building"),
832 static char sp_explanation[
SP_MAX][128];
833 static char sp_explanations[
SP_MAX*128];
844 fc_snprintf(sp_explanations,
sizeof(sp_explanations),
845 "%s",
_(
"Specialists: "));
853 fc_snprintf(sp_explanation[sp],
sizeof(sp_explanation[sp]),
856 "%s%s", (sp == 0) ?
"" :
", ",
867 static char sp_summary[128];
924#define SPECVEC_TAG datum
933 int len = right - left;
997 const struct datum_vector *b)
1001 n =
MIN(a->size, b->size);
1003 for (i = 0; i <
n; i++) {
1013 return a->size - b->size;
1021 const char *string_start;
1023 datum_vector_init(data);
1030 value = strtof(
str, &endptr);
1031 if (errno != 0 || endptr ==
str || !isfinite(value)) {
1039 if (
str != string_start) {
1041 datum_vector_append(data, d);
1045 datum_vector_append(data, d);
1048 string_start =
str = endptr;
1053 if (
str != string_start) {
1057 datum_vector_append(data, d);
1068 for (i = 0; i < data->size; i++) {
1071 datum_vector_free(data);
1079 struct datum_vector data1, data2;
1084 }
else if (NULL == str1) {
1086 }
else if (NULL == str2) {
1107 return target->
kind == VUT_IMPROVEMENT
int city_granary_size(int city_size)
int city_build_slots(const struct city *pcity)
const char * city_name_get(const struct city *pcity)
bool city_production_has_flag(const struct city *pcity, enum impr_flag_id flag)
int city_production_turns_to_build(const struct city *pcity, bool include_shield_stock)
bool city_unhappy(const struct city *pcity)
bool city_celebrating(const struct city *pcity)
int city_illness_calc(const struct city *pcity, int *ill_base, int *ill_size, int *ill_trade, int *ill_pollution)
static int cmp(int v1, int v2)
int city_turns_to_grow(const struct city *pcity)
const char * city_production_name_translation(const struct city *pcity)
static citizens city_size_get(const struct city *pcity)
#define city_owner(_pcity_)
char * city_production_cost_str(const struct city *pcity)
static const char * cr_entry_hstate_concise(const struct city *pcity, const void *data)
static const char * cr_entry_tradeplus(const struct city *pcity, const void *data)
static const char * cr_entry_specialist(const struct city *pcity, const void *data)
static const char * cr_entry_present(const struct city *pcity, const void *data)
static const char * cr_entry_hstate_verbose(const struct city *pcity, const void *data)
int num_city_report_spec(void)
static void init_datum_string(struct datum *dat, const char *left, const char *right)
static const char * cr_entry_nation(const struct city *pcity, const void *data)
static const char * cr_entry_luxury(const struct city *pcity, const void *data)
static const char * cr_entry_gold(const struct city *pcity, const void *data)
static const char * cr_entry_building(const struct city *pcity, const void *data)
static const char * cr_entry_culture(const struct city *pcity, const void *data)
static void split_string(struct datum_vector *data, const char *str)
static const char * cr_entry_plague_risk(const struct city *pcity, const void *data)
static const char * cr_entry_trade_routes(const struct city *pcity, const void *data)
void init_city_report_game_data(void)
static const char * cr_entry_size(const struct city *pcity, const void *data)
static void free_data(struct datum_vector *data)
static const char * cr_entry_foodplus(const struct city *pcity, const void *data)
static const char * cr_entry_science(const struct city *pcity, const void *data)
static int data_compare(const struct datum_vector *a, const struct datum_vector *b)
static const char * cr_entry_pollution(const struct city *pcity, const void *data)
static const struct city_report_spec base_city_report_specs[]
static const char * cr_entry_defense(const struct city *pcity, const void *data)
static const char * cr_entry_cityname(const struct city *pcity, const void *data)
static const char * cr_entry_continent(const struct city *pcity, const void *data)
static const char * cr_entry_performance(const struct city *pcity, const void *data)
static const char * cr_entry_build_cost(const struct city *pcity, const void *data)
static const char * cr_entry_growturns(const struct city *pcity, const void *data)
bool can_city_sell_universal(const struct city *pcity, const struct universal *target)
static const char * cr_entry_unhappy(const struct city *pcity, const void *data)
static const char * cr_entry_workers(const struct city *pcity, const void *data)
struct city_report_spec * city_report_specs
static const char * cr_entry_angry(const struct city *pcity, const void *data)
int cityrepfield_compare(const char *str1, const char *str2)
static const char * cr_entry_attack(const struct city *pcity, const void *data)
const char * city_report_spec_tagname(int i)
static const char * cr_entry_build_slots(const struct city *pcity, const void *data)
static void free_datum(struct datum *dat)
static const char * cr_entry_corruption(const struct city *pcity, const void *data)
static const char * cr_entry_specialists(const struct city *pcity, const void *data)
static const char * cr_entry_supported(const struct city *pcity, const void *data)
static const char * cr_entry_resources(const struct city *pcity, const void *data)
static void init_datum_number(struct datum *dat, float val)
static const char * cr_entry_cma(const struct city *pcity, const void *data)
static int datum_compare(const struct datum *a, const struct datum *b)
static const char * cr_entry_prodplus(const struct city *pcity, const void *data)
bool * city_report_spec_show_ptr(int i)
static const char * cr_entry_history(const struct city *pcity, const void *data)
static const char * cr_entry_content(const struct city *pcity, const void *data)
static int num_creport_cols
static const char * cr_entry_happy(const struct city *pcity, const void *data)
static const char * cr_entry_waste(const struct city *pcity, const void *data)
static const char * cr_entry_output(const struct city *pcity, const void *data)
const char * cmafec_get_short_descr_of_city(const struct city *pcity)
int city_history_gain(const struct city *pcity)
static void attack(QVariant data1, QVariant data2)
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
static struct cma_dialog * cma
bool can_city_sell_building(const struct city *pcity, const struct impr_type *pimprove)
#define fc_assert(condition)
#define fc_realloc(ptr, sz)
const char * nation_adjective_for_player(const struct player *pplayer)
struct client_options gui_options
const char * specialists_abbreviation_string(void)
struct specialist * specialist_by_number(const Specialist_type_id id)
Specialist_type_id specialist_index(const struct specialist *sp)
const char * specialist_rule_name(const struct specialist *sp)
const char * specialist_plural_translation(const struct specialist *sp)
Specialist_type_id specialist_count(void)
const char * specialist_abbreviation_translation(const struct specialist *sp)
const char * specialists_string(const citizens *specialist_list)
#define specialist_type_iterate_end
#define specialist_type_iterate(sp)
const char *(* func)(const struct city *pcity, const void *data)
citizens feel[CITIZEN_LAST][FEELING_LAST]
citizens specialists[SP_MAX]
struct unit_list * units_supported
struct city::@17::@20 client
struct packet_game_info info
bool concise_city_production
int fc_snprintf(char *str, size_t n, const char *format,...)
int cat_snprintf(char *str, size_t n, const char *format,...)
#define sz_strlcpy(dest, src)
#define trade_routes_iterate_end
#define trade_routes_iterate(c, proute)
const struct impr_type * building
#define unit_list_iterate(unitlist, punit)
#define unit_list_iterate_end
const struct unit_type * unit_type_get(const struct unit *punit)
bool worklist_is_empty(const struct worklist *pwl)