45#define RESULT_COLUMNS 10
46#define BUFFER_SIZE 100
47#define MAX_LEN_PRESET_NAME 80
54#define SPECLIST_TAG preset
55#define SPECLIST_TYPE struct cma_preset
58#define preset_list_iterate(presetlist, ppreset) \
59 TYPED_LIST_ITERATE(struct cma_preset, presetlist, ppreset)
60#define preset_list_iterate_end LIST_ITERATE_END
226 return Q_(
"?cma:none");
242 return Q_(
"?cma:custom");
253 int stock,
cost, turns;
254 static char buffer[50];
261 stock =
pcity->food_stock;
268 }
else if (surplus > 0) {
269 turns = ((
cost - stock - 1) / surplus) + 1 + 1;
274 turns = (stock / surplus);
277 fc_snprintf(buffer,
sizeof(buffer),
PL_(
"%d turn",
"%d turns", turns),
287 int stock,
cost, turns;
288 static char buffer[50];
297 (
pcity->production.value.building),
sizeof(buffer));
300 stock =
pcity->shield_stock + surplus;
305 }
else if (surplus > 0) {
306 turns = ((
cost - stock - 1) / surplus) + 1 + 1;
311 turns = (stock / surplus);
314 fc_snprintf(buffer,
sizeof(buffer),
PL_(
"%d turn",
"%d turns", turns),
330 static char buffer[600];
350 result->
happy ?
_(
" happy") :
"");
363 "Food: %10s Gold: %10s\n"
364 "Production: %10s Luxury: %10s\n"
365 "Trade: %10s Science: %10s\n"
369 "Production completed: %s"),
390 .require_happy =
FALSE,
391 .allow_disorder =
FALSE,
392 .allow_specialists =
TRUE,
393 .factor = {10, 5, 0, 4, 0, 4},
397 .minimal_surplus = {-20, 0, 0, -20, 0, 0},
398 .require_happy =
FALSE,
399 .allow_disorder =
FALSE,
400 .allow_specialists =
TRUE,
401 .factor = {25, 5, 0, 4, 0, 4},
405 .minimal_surplus = {0, -20, 0, -20, 0, 0},
406 .require_happy =
FALSE,
407 .allow_disorder =
FALSE,
408 .allow_specialists =
TRUE,
409 .factor = {10, 25, 0, 4, 0, 4},
413 .minimal_surplus = {0, 0, 0, -20, 0, 0},
414 .require_happy =
FALSE,
415 .allow_disorder =
FALSE,
416 .allow_specialists =
TRUE,
417 .factor = {10, 5, 0, 25, 0, 4},
421 .minimal_surplus = {0, 0, 0, -20, 0, 0},
422 .require_happy =
FALSE,
423 .allow_disorder =
FALSE,
424 .allow_specialists =
TRUE,
425 .factor = {10, 5, 0, 4, 0, 25},
430 N_(
"?cma:Very happy"),
431 N_(
"?cma:Prefer food"),
432 N_(
"?cma:Prefer production"),
433 N_(
"?cma:Prefer gold"),
434 N_(
"?cma:Prefer science")
void register_agent(const struct agent *agent)
void attr_city_set(enum attr_city what, int city_id, size_t data_length, const void *const data)
@ ATTR_CITY_CMAFE_PARAMETER
int city_production_build_shield_cost(const struct city *pcity)
int city_granary_size(int city_size)
bool city_production_is_genus(const struct city *pcity, enum impr_genus_id genus)
static citizens city_size_get(const struct city *pcity)
#define output_type_iterate(output)
#define output_type_iterate_end
static struct ai_type * self
void cm_copy_parameter(struct cm_parameter *dest, const struct cm_parameter *const src)
void cm_init_parameter(struct cm_parameter *dest)
int cm_result_specialists(const struct cm_result *result)
bool cm_are_parameter_equal(const struct cm_parameter *const p1, const struct cm_parameter *const p2)
bool cma_is_city_under_agent(const struct city *pcity, struct cm_parameter *parameter)
bool cma_get_parameter(enum attr_city attr, int city_id, struct cm_parameter *parameter)
void cma_set_parameter(enum attr_city attr, int city_id, const struct cm_parameter *parameter)
const char * cmafec_get_short_descr(const struct cm_parameter *const parameter)
void cmafec_set_fe_parameter(struct city *pcity, const struct cm_parameter *const parameter)
static struct preset_list * preset_list
char * cmafec_preset_get_descr(int idx)
const char * cmafec_get_result_descr(struct city *pcity, const struct cm_result *result, const struct cm_parameter *const parameter)
const char * cmafec_get_short_descr_of_city(const struct city *pcity)
static const char * get_city_growth_string(struct city *pcity, int surplus)
const struct cm_parameter * cmafec_preset_get_parameter(int idx)
void cmafec_preset_add(const char *descr_name, struct cm_parameter *pparam)
int cmafec_preset_get_index_of_parameter(const struct cm_parameter *const parameter)
static void city_remove(int city_id)
static const char * get_prod_complete_string(struct city *pcity, int surplus)
void cmafec_preset_remove(int idx)
#define MAX_LEN_PRESET_NAME
int cmafec_preset_num(void)
void create_default_cma_presets(void)
void cmafec_get_fe_parameter(struct city *pcity, struct cm_parameter *dest)
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 const struct action *paction struct unit struct city * pcity
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
size_t get_internal_string_length(const char *text)
#define PL_(String1, String2, n)
const char * improvement_name_translation(const struct impr_type *pimprove)
#define fc_assert_ret(condition)
#define fc_assert_ret_val(condition, val)
#define log_debug(message,...)
const char * specialists_abbreviation_string(void)
const char * specialists_string(const citizens *specialist_list)
int minimal_surplus[O_LAST]
citizens specialists[SP_MAX]
struct cm_parameter parameter
int fc_snprintf(char *str, size_t n, const char *format,...)
size_t fc_strlcpy(char *dest, const char *src, size_t n)