57 const struct player *other_player,
64 const struct player *other_player,
84#define REQUC_LOCAL unchanging_local
100#define REQUC_PRESENT unchanging_present
115#define REQUC_WORLD unchanging_world
139#define REQUC_NALLY unchanging_noally
162#define REQUC_CITYTILE unchanging_citytile
183#define REQUC_CITYSTATUS unchanging_citystatus
223#define REQUC_IMPR unchanging_building
405 if (
source->value.utype) {
417 if (
source->value.uclass) {
422 source->value.unitclassflag
430 if (
source->value.minveteran > 0) {
448 if (
source->value.minmoves > 0) {
454 if (
source->value.min_hit_points > 0) {
460 if (
source->value.age > 0) {
466 if (
source->value.form_age > 0) {
472 if (
source->value.min_techs > 0) {
490 if (
source->value.specialist) {
496 if (
source->value.minsize > 0) {
502 if (
source->value.minculture > 0) {
508 if (
source->value.minforeignpct > 0) {
520 if (0 <=
source->value.max_tile_units) {
525 source->value.terrainclass
549 if (
source->value.mincalfrag >= 0) {
573 source->value.terrainalter
884 return source->value.techflag;
895 return source->value.impr_genus;
897 return source->value.impr_flag;
899 return source->value.plr_flag;
907 return source->value.terrainflag;
921 return source->value.diplrel;
925 return source->value.unitflag;
929 return source->value.unitclassflag;
931 return source->value.minveteran;
933 return source->value.unit_state;
935 return source->value.activity;
937 return source->value.minmoves;
939 return source->value.min_hit_points;
943 return source->value.form_age;
945 return source->value.min_techs;
949 return source->value.outputtype;
953 return source->value.minsize;
955 return source->value.minculture;
957 return source->value.minforeignpct;
959 return source->value.ai_level;
961 return source->value.max_tile_units;
963 return source->value.terrainclass;
965 return source->value.roadflag;
967 return source->value.extraflag;
969 return source->value.minyear;
971 return source->value.mincalfrag;
973 return source->value.topo_property;
975 return source->value.wrap_property;
977 return source->value.ssetval;
979 return source->value.terrainalter;
981 return source->value.citytile;
983 return source->value.citystatus;
985 return source->value.plrstate;
990 return source->value.latitude;
1048 const char *error =
NULL;
1054 error =
"bad type or name";
1315 error =
"bad range";
1393 error =
"bad 'survives'";
1398 log_error(
"Invalid requirement %s | %s | %s | %s | %s: %s",
1400 present ?
"present" :
"", value, error);
1497 return (
impr_req->source.value.building->genus
1503 return (
impr_req->source.value.building->genus
1584 switch (
ct_req->source.value.citytile) {
1602 &&
ct_req->source.value.citytile
1787#define EXTRACT_INFO(req) \
1788 if (req->present) { \
1789 if (req->source.kind == VUT_MINLATITUDE) { \
1791 minimum = MAX(minimum, req->source.value.latitude); \
1794 maximum = MIN(maximum, req->source.value.latitude); \
1797 covered_range = MAX(covered_range, req->range); \
1798 if (req->source.kind == VUT_MINLATITUDE) { \
1800 maximum = MIN(maximum, req->source.value.latitude - 1); \
1803 minimum = MAX(minimum, req->source.value.latitude + 1); \
1812 return (maximum < minimum
1938#define IS_REQ_ACTIVE_VARIANT_ASSERT(_kind) \
1940 fc_assert_ret_val(req != NULL, TRI_MAYBE); \
1941 fc_assert_ret_val(req->source.kind == _kind, TRI_MAYBE); \
1942 fc_assert(context != NULL); \
1955 const struct player *other_player,
1973 log_error(
"World-ranged requirements are only supported for wonders.");
1986 log_error(
"World-ranged requirements are only supported for wonders.");
2009 log_error(
"Player-ranged requirements are only supported for wonders.");
2023 log_error(
"Player-ranged requirements are only supported for wonders.");
2036 const struct city *pcity;
2043 log_error(
"Island-ranged requirements are only supported for wonders.");
2067 const struct player *other_player,
2088 switch (req->
range) {
2117 log_error(
"Surviving requirements are only supported at "
2118 "World/Alliance/Team/Player ranges.");
2127 switch (req->
range) {
2155 continent, building)
2189 if (
context->building == building) {
2233 const struct player *other_player,
2252 if (pcity ==
NULL) {
2278 const struct player *other_player,
2283 switch (req->
range) {
2325 const struct player *other_player,
2330 switch (req->
range) {
2366 const struct player *other_player,
2371 switch (req->
range) {
2406 const struct player *other_player,
2421 switch (req->
range) {
2471 const struct player *other_player,
2480 switch (req->
range) {
2535 const struct player *other_player,
2544 switch (req->
range) {
2609 const struct player *other_player,
2618 switch (req->
range) {
2680 const struct player *other_player,
2690 switch (req->
range) {
2749 const struct player *other_player,
2759 switch (req->
range) {
2847 const struct player *other_player,
2856 switch (req->
range) {
2894 const struct player *other_player,
2915 const struct player *other_player,
2935 const struct player *other_player,
2955 const struct player *other_player,
2958 const struct terrain *pterrain;
2964 switch (req->
range) {
2985 if (pterrain !=
NULL) {
2998 if (pterrain !=
NULL) {
3052 const struct player *other_player,
3062 switch (req->
range) {
3154 const struct player *other_player,
3164 switch (req->
range) {
3261 const struct player *other_player,
3271 switch (req->
range) {
3365 const struct player *other_player,
3375 switch (req->
range) {
3462 const struct player *other_player,
3475 switch (req->
range) {
3508 const struct player *other_player,
3531 const struct player *other_player,
3554 const struct player *other_player,
3559 switch (req->
range) {
3589 const struct player *other_player,
3598 &&
context->player->ai_common.skill_level
3613 const struct player *other_player,
3622 switch (req->
range) {
3675 const struct player *other_player,
3684 switch (req->
range) {
3732 const struct player *other_player,
3742 switch (req->
range) {
3807 const struct player *other_player,
3816 switch (req->
range) {
3849 const struct player *other_player,
3903 const struct player *other_player,
3923 const struct player *other_player,
3947 const struct player *other_player,
3964 const struct player *other_player,
3996 const struct player *other_player,
4018 const struct player *other_player,
4038 const struct player *other_player,
4067 const struct player *other_player,
4096 const struct player *other_player,
4126 const struct player *other_player,
4155 const struct player *other_player,
4165 "Unsupported range \"%s\"",
4220 const struct player *other_player,
4230 "Unsupported range \"%s\"",
4247 switch (
context->unit->activity) {
4272 const struct player *other_player,
4296 const struct player *other_player,
4305 <=
context->unit->moves_left);
4320 const struct player *other_player,
4343 const struct player *other_player,
4348 switch (req->
range) {
4391 const struct player *other_player,
4396 switch (req->
range) {
4416 const struct city *pcity)
4418 if (pcity ==
NULL) {
4435 const struct player *other_player,
4451 switch (req->
range) {
4492 switch (req->
range) {
4532 switch (req->
range) {
4572 switch (req->
range) {
4626 switch (req->
range) {
4717 switch (req->
range) {
4725 if (0 == tc ||
ukt) {
4728 for (
int i = 0;
i <
n;
i++) {
4753 for (
int i = 0;
i <
n;
i++) {
4777 for (
int i = 0;
i <
n;
i++) {
4807 log_error(
"is_req_active(): citytile %d not supported.",
4823 const struct player *other_player,
4836 switch (citystatus) {
4838 switch (req->
range) {
4882 switch (req->
range) {
4889 if (
context->city->had_famine) {
4923 switch (req->
range) {
4930 if (
context->city->anarchy > 0) {
4964 switch (req->
range) {
4971 if (
context->city->rapture > 0) {
5005 switch (req->
range) {
5050 log_error(
"is_req_active(): citystatus %d not supported.",
5066 const struct player *other_player,
5108 const struct player *other_player,
5121 context->city->counter_values[
5136 const struct player *other_player,
5182 const struct player *other_player,
5203 switch (req->
range) {
5257 "Illegal range %d for latitude requirement.", req->
range);
5272 const struct player *other_player,
5290 const struct player *other_player,
5309 const struct player *other_player,
5328 const struct player *other_player,
5348 const struct player *other_player,
5435 const struct player *other_player,
5463 const struct player *other_player,
5471 log_error(
"tri_req_present(): invalid source kind %d.",
5491 const struct player *other_player,
5524 const struct player *other_player,
5544 const struct player *other_player,
5568 const struct player *other_player,
5620 switch (req->
range) {
5692 const struct player *other_player,
5720 const struct player *other_player,
5774 "Invalid source kind %d.", req->
source.
kind);
5815 const struct player *other_player,
5865 if (
preq->present &&
preq->source.kind == kind) {
6153 sizeof(
out->description_translated));
6158 for (
i = 0;
i <
out->num_suggested_solutions;
i++) {
6161 out->suggested_solutions[
i].vector_number = -1;
6162 out->suggested_solutions[
i].req.source.kind =
VUT_NONE;
6177 const char *descr, ...)
6204 issue->num_suggested_solutions = 0;
6251 N_(
"Requirements {%s} and {%s} contradict each other."),
6333 if (
preq->present) {
6343 N_(
"Requirement {%s} requires %s but it will never be"
6360 N_(
"Requirement {%s} mentions %s but it will never be there."),
6422 N_(
"Requirements {%s} and {%s} are the same."),
6619 static char buffer[10];
6881 Q_(
"?utflag:\"%s\" units"),
6894 Q_(
"?ucflag:\"%s\" units"),
6896 psource->value.unitclassflag));
6904 switch (
psource->value.unit_state) {
6913 _(
"On livable tile"));
6927 _(
"On native tile"));
6933 _(
"In native extra"));
6942 "Invalid unit state property.");
6959 psource->value.min_hit_points);
6995 psource->value.minforeignpct);
7005 "<=%d units",
psource->value.max_tile_units),
7006 psource->value.max_tile_units);
7016 Q_(
"?terrflag:\"%s\" terrain"),
7023 Q_(
"?roadflag:\"%s\" road"),
7029 Q_(
"?extraflag:\"%s\" extra"),
7062 switch (
psource->value.citytile) {
7089 switch (
psource->value.citystatus) {
7144 switch (target->
kind) {
7165 bool changed =
FALSE;
7278 "No req item found function for %s",
7302 "No req item found function for %s",
7310 if (
preq->present) {
7315 if (
preq->present) {
7342 log_error(
"Unhandled item_found value");
7354 switch (
preq->source.kind) {
7398 switch (
preq->source.kind) {
7401 if (
source->value.building ==
preq->source.value.building) {
7406 if (
source->value.building->genus ==
preq->source.value.impr_genus) {
7412 preq->source.value.impr_flag)) {
7431 switch (
preq->source.kind) {
7454 switch (
preq->source.kind) {
7483 switch (
preq->source.kind) {
7501 switch (
preq->source.kind) {
7512 preq->source.value.terrainalter)
7529 switch (
preq->source.kind) {
7531 return (
source->value.citytile ==
preq->source.value.citytile
7549 switch (
preq->source.kind) {
7597 if (
preq->source.value.diplrel ==
source->value.diplrel) {
7638 switch (
preq->source.kind) {
7659 switch (
source->value.unit_state) {
7670 if (
source->value.unit_state ==
preq->source.value.unit_state) {
7721 const int max_value)
7725 const int pres_start = (present ? 0 : max_value);
bool achievement_player_has(const struct achievement *pach, const struct player *pplayer)
struct achievement * achievement_by_number(int id)
int achievement_number(const struct achievement *pach)
const char * achievement_rule_name(struct achievement *pach)
struct achievement * achievement_by_rule_name(const char *name)
const char * achievement_name_translation(struct achievement *pach)
bool achievement_claimed(const struct achievement *pach)
const char * action_name_translation(const struct action *action)
bool action_is_in_use(struct action *paction)
struct action * action_by_rule_name(const char *name)
const char * action_rule_name(const struct action *action)
int action_number(const struct action *action)
static struct action * action_by_number(action_id act_id)
void astr_free(struct astring *astr)
void astr_set(struct astring *astr, const char *format,...)
void astr_init(struct astring *astr)
static const char * astr_str(const struct astring *astr) fc__attribute((nonnull(1)))
#define BV_ISSET(bv, bit)
const char * textcalfrag(int frag)
const char * textyear(int year)
citizens citizens_nation_foreign(const struct city *pcity)
#define citizens_iterate_end
#define citizens_iterate(_pcity, _pslot, _nationality)
bool city_has_building(const struct city *pcity, const struct impr_type *pimprove)
Output_type_id output_type_by_identifier(const char *id)
const char * get_output_identifier(Output_type_id output)
const char * get_output_name(Output_type_id output)
int city_map_radius_sq_get(const struct city *pcity)
#define city_tile(_pcity_)
static citizens city_size_get(const struct city *pcity)
#define city_owner(_pcity_)
static bool is_city_center(const struct city *pcity, const struct tile *ptile)
#define city_tile_iterate(_nmap, _radius_sq, _city_tile, _tile)
#define city_tile_iterate_end
#define city_built_iterate(_pcity, _p)
#define city_built_iterate_end
int counter_index(const struct counter *pcount)
const char * counter_name_translation(const struct counter *counter)
struct counter * counter_by_rule_name(const char *name)
const char * counter_rule_name(struct counter *pcount)
struct counter * counter_by_id(int id)
int counter_id(struct counter *pcount)
int city_culture(const struct city *pcity)
int player_culture(const struct player *plr)
struct unit struct city struct unit * target_unit
struct unit struct city struct unit struct tile * target_tile
int get_world_bonus(enum effect_type effect_type)
static bool is_server(void)
signed short Continent_id
#define PL_(String1, String2, n)
const char * government_name_translation(const struct government *pgovern)
struct government * government_by_number(const Government_type_id gov)
struct government * government_of_player(const struct player *pplayer)
Government_type_id government_number(const struct government *pgovern)
const char * government_rule_name(const struct government *pgovern)
struct government * government_by_rule_name(const char *name)
static GtkWidget * source
struct impr_type * improvement_by_number(const Impr_type_id id)
bool great_wonder_is_built(const struct impr_type *pimprove)
bool great_wonder_is_destroyed(const struct impr_type *pimprove)
bool wonder_is_lost(const struct player *pplayer, const struct impr_type *pimprove)
bool wonder_is_built(const struct player *pplayer, const struct impr_type *pimprove)
Impr_type_id improvement_number(const struct impr_type *pimprove)
bool can_improvement_go_obsolete(const struct impr_type *pimprove)
const char * improvement_rule_name(const struct impr_type *pimprove)
struct city * city_from_wonder(const struct player *pplayer, const struct impr_type *pimprove)
int impr_build_shield_cost(const struct city *pcity, 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)
struct impr_type * improvement_by_rule_name(const char *name)
const char * improvement_name_translation(const struct impr_type *pimprove)
bool great_wonder_is_available(const struct impr_type *pimprove)
#define fc_assert_msg(condition, message,...)
#define fc_assert(condition)
#define fc_assert_ret_val(condition, val)
#define log_error(message,...)
#define fc_assert_ret_val_msg(condition, val, message,...)
bool is_tiles_adjacent(const struct tile *tile0, const struct tile *tile1)
int map_signed_latitude(const struct tile *ptile)
bool same_pos(const struct tile *tile1, const struct tile *tile2)
int map_distance(const struct tile *tile0, const struct tile *tile1)
#define current_topo_has_flag(flag)
#define MAP_MAX_REAL_LATITUDE(_nmap)
#define square_iterate(nmap, center_tile, radius, tile_itr)
#define cardinal_adjc_iterate_end
#define adjc_iterate(nmap, center_tile, itr_tile)
#define square_iterate_end
#define cardinal_adjc_iterate(nmap, center_tile, itr_tile)
#define circle_iterate(nmap, center_tile, sq_radius, tile_itr)
#define current_wrap_has_flag(flag)
#define MAP_MIN_REAL_LATITUDE(_nmap)
#define circle_iterate_end
const char * move_points_text(int mp, bool reduce)
bool can_unit_exist_at_tile(const struct civ_map *nmap, const struct unit *punit, const struct tile *ptile)
bool is_native_tile(const struct unit_type *punittype, const struct tile *ptile)
struct nation_group * nation_group_by_rule_name(const char *name)
const char * nation_rule_name(const struct nation_type *pnation)
Nation_type_id nation_number(const struct nation_type *pnation)
const char * nation_adjective_translation(const struct nation_type *pnation)
struct nation_type * nation_by_number(const Nation_type_id nation)
const char * nation_group_rule_name(const struct nation_group *pgroup)
struct nation_type * nation_of_player(const struct player *pplayer)
bool nation_is_in_group(const struct nation_type *pnation, const struct nation_group *pgroup)
const char * nation_group_name_translation(const struct nation_group *pgroup)
struct nation_type * nation_by_rule_name(const char *name)
struct nation_group * nation_group_by_number(int id)
int nation_group_number(const struct nation_group *pgroup)
#define NO_NATION_SELECTED
bool player_knows_techs_with_flag(const struct player *pplayer, enum tech_flag_id flag)
bool player_has_state(const struct player *pplayer, enum plrstate_type state)
bv_diplrel_all_reqs diplrel_req_contradicts(const struct requirement *req)
int diplrel_by_rule_name(const char *value)
bool players_on_same_team(const struct player *pplayer1, const struct player *pplayer2)
bool is_diplrel_to_other(const struct player *pplayer, int diplrel)
bool player_has_flag(const struct player *pplayer, enum plr_flag_id flag)
const char * diplrel_name_translation(int value)
bool is_diplrel_between(const struct player *player1, const struct player *player2, int diplrel)
int player_age(const struct player *pplayer)
bool pplayers_allied(const struct player *pplayer, const struct player *pplayer2)
struct player * player_slot_get_player(const struct player_slot *pslot)
const char * diplrel_rule_name(int value)
#define players_iterate_end
#define players_iterate(_pplayer)
#define player_nation(_plr_)
#define players_iterate_alive_end
#define players_iterate_alive(_pplayer)
static enum fc_tristate is_latitude_req_active(const struct civ_map *nmap, const struct req_context *context, const struct player *other_player, const struct requirement *req)
static enum req_item_found terrain_type_found(const struct requirement *preq, const struct universal *source)
bool universal_never_there(const struct universal *source)
static enum fc_tristate is_topology_req_active(const struct civ_map *nmap, const struct req_context *context, const struct player *other_player, const struct requirement *req)
static enum fc_tristate is_diplrel_unitany_req_active(const struct civ_map *nmap, const struct req_context *context, const struct player *other_player, const struct requirement *req)
bool universal_is_relevant_to_requirement(const struct requirement *req, const struct universal *source)
#define EXTRACT_INFO(req)
bool is_req_in_vec(const struct requirement *req, const struct requirement_vector *vec)
static int num_city_buildings(const struct city *pcity, const struct impr_type *building)
int universal_build_shield_cost(const struct city *pcity, const struct universal *target)
static enum req_item_found city_tile_found(const struct requirement *preq, const struct universal *source)
struct req_vec_problem * req_vec_get_first_contradiction(const struct requirement_vector *vec, requirement_vector_number get_num, const void *parent_item)
static universal_found universal_found_function[VUT_COUNT]
static enum req_unchanging_status unchanging_local(const struct civ_map *nmap, enum req_unchanging_status def, const struct req_context *context, const struct requirement *req)
const struct req_context * req_context_empty(void)
static enum req_item_found unit_type_found(const struct requirement *preq, const struct universal *source)
static enum fc_tristate is_mincalfrag_req_active(const struct civ_map *nmap, const struct req_context *context, const struct player *other_player, const struct requirement *req)
void universal_extraction(const struct universal *source, int *kind, int *value)
static int num_player_buildings(const struct player *pplayer, const struct impr_type *building)
static enum fc_tristate is_extraflag_req_active(const struct civ_map *nmap, const struct req_context *context, const struct player *other_player, const struct requirement *req)
static enum fc_tristate is_minforeignpct_req_active(const struct civ_map *nmap, const struct req_context *context, const struct player *other_player, const struct requirement *req)
static int num_continent_buildings(const struct player *pplayer, int continent, const struct impr_type *building)
static enum fc_tristate tri_req_present(const struct civ_map *nmap, const struct req_context *context, const struct player *other_player, const struct requirement *req)
const char * req_to_fstring(const struct requirement *req, struct astring *astr)
static enum fc_tristate is_style_req_active(const struct civ_map *nmap, const struct req_context *context, const struct player *other_player, const struct requirement *req)
req_vec_num_in_item req_vec_vector_number(const void *parent_item, const struct requirement_vector *vec)
static bool present_implies_not_present(const struct requirement *req1, const struct requirement *req2)
static enum fc_tristate is_roadflag_req_active(const struct civ_map *nmap, const struct req_context *context, const struct player *other_player, const struct requirement *req)
struct requirement_vector * req_vec_by_number(const void *parent_item, req_vec_num_in_item number)
bool universal_fulfills_requirements(bool check_necessary, const struct requirement_vector *reqs, const struct universal *source)
static bool activity_is_valid_in_requirement(enum unit_activity act)
static enum fc_tristate is_specialist_req_active(const struct civ_map *nmap, const struct req_context *context, const struct player *other_player, const struct requirement *req)
static enum req_unchanging_status unchanging_noally(const struct civ_map *nmap, enum req_unchanging_status def, const struct req_context *context, const struct requirement *req)
static enum fc_tristate is_minveteran_req_active(const struct civ_map *nmap, const struct req_context *context, const struct player *other_player, const struct requirement *req)
static enum fc_tristate is_unitstate_req_active(const struct civ_map *nmap, const struct req_context *context, const struct player *other_player, const struct requirement *req)
bool req_vec_change_apply(const struct req_vec_change *modification, requirement_vector_by_number getter, const void *parent_item)
void universal_copy(struct universal *dst, const struct universal *src)
static enum req_unchanging_status unchanging_building(const struct civ_map *nmap, enum req_unchanging_status def, const struct req_context *context, const struct requirement *req)
bool are_requirements_equal(const struct requirement *req1, const struct requirement *req2)
static enum req_item_found extra_type_found(const struct requirement *preq, const struct universal *source)
static enum fc_tristate is_diplrel_unitany_in_range(const struct tile *target_tile, const struct player *other_player, enum req_range range, int diplrel)
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)
static enum fc_tristate is_buildingflag_req_active(const struct civ_map *nmap, const struct req_context *context, const struct player *other_player, const struct requirement *req)
static enum fc_tristate is_nation_req_active(const struct civ_map *nmap, const struct req_context *context, const struct player *other_player, const struct requirement *req)
bool is_req_active(const struct req_context *context, const struct player *other_player, const struct requirement *req, const enum req_problem_type prob_type)
static enum fc_tristate is_buildinggenus_req_active(const struct civ_map *nmap, const struct req_context *context, const struct player *other_player, const struct requirement *req)
const char * req_vec_change_translation(const struct req_vec_change *change, const requirement_vector_namer namer)
static enum fc_tristate is_diplrel_req_active(const struct civ_map *nmap, const struct req_context *context, const struct player *other_player, const struct requirement *req)
struct requirement req_from_str(const char *type, const char *range, bool survives, bool present, bool quiet, const char *value)
struct req_vec_problem * req_vec_suggest_repair(const struct requirement_vector *vec, requirement_vector_number get_num, const void *parent_item)
void universal_value_from_str(struct universal *source, const char *value)
static enum fc_tristate is_buildingflag_in_city(const struct city *pcity, enum impr_flag_id flag)
void req_get_values(const struct requirement *req, int *type, int *range, bool *survives, bool *present, bool *quiet, int *value)
struct requirement req_from_values(int type, int range, bool survives, bool present, bool quiet, int value)
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)
const char * universal_rule_name(const struct universal *psource)
static enum fc_tristate is_ai_req_active(const struct civ_map *nmap, const struct req_context *context, const struct player *other_player, const struct requirement *req)
static enum req_unchanging_status unchanging_present(const struct civ_map *nmap, enum req_unchanging_status def, const struct req_context *context, const struct requirement *req)
static enum fc_tristate is_plr_flag_req_active(const struct civ_map *nmap, const struct req_context *context, const struct player *other_player, const struct requirement *req)
static enum fc_tristate is_citytile_req_active(const struct civ_map *nmap, const struct req_context *context, const struct player *other_player, const struct requirement *req)
static enum fc_tristate is_nationality_req_active(const struct civ_map *nmap, const struct req_context *context, const struct player *other_player, const struct requirement *req)
static enum fc_tristate is_activity_req_active(const struct civ_map *nmap, const struct req_context *context, const struct player *other_player, const struct requirement *req)
bool universal_replace_in_req_vec(struct requirement_vector *reqs, const struct universal *to_replace, const struct universal *replacement)
static enum fc_tristate is_wrap_req_active(const struct civ_map *nmap, const struct req_context *context, const struct player *other_player, const struct requirement *req)
static enum req_item_found action_found(const struct requirement *preq, const struct universal *source)
enum fc_tristate default_tester_cb(const struct req_context *context, const struct player *other_player, const struct requirement *req, void *data, int n_data)
bool are_requirements_contradictions(const struct requirement *req1, const struct requirement *req2)
enum fc_tristate tri_req_active_turns(int pass, int period, const struct req_context *context, const struct player *other_player, const struct requirement *req)
static enum fc_tristate is_diplrel_unitany_o_req_active(const struct civ_map *nmap, const struct req_context *context, const struct player *other_player, const struct requirement *req)
struct req_vec_problem * req_vec_problem_new(int num_suggested_solutions, const char *descr,...)
static enum fc_tristate is_form_age_req_active(const struct civ_map *nmap, const struct req_context *context, const struct player *other_player, const struct requirement *req)
static enum fc_tristate is_diplrel_in_range(const struct player *target_player, const struct player *other_player, enum req_range range, int diplrel)
static enum fc_tristate is_counter_req_active(const struct civ_map *nmap, const struct req_context *context, const struct player *other_player, const struct requirement *req)
static enum fc_tristate is_none_req_active(const struct civ_map *nmap, const struct req_context *context, const struct player *other_player, const struct requirement *req)
bool universal_is_legal_in_requirement(const struct universal *univ)
static enum fc_tristate is_maxunitsontile_req_active(const struct civ_map *nmap, const struct req_context *context, const struct player *other_player, const struct requirement *req)
int requirement_kind_ereq(const int value, const enum req_range range, const bool present, const int max_value)
static enum fc_tristate is_terrain_req_active(const struct civ_map *nmap, const struct req_context *context, const struct player *other_player, const struct requirement *req)
void req_vec_problem_free(struct req_vec_problem *issue)
static struct req_def req_definitions[VUT_COUNT]
static bool impr_contra_flag(const struct requirement *impr_req, const struct requirement *flag_req)
static enum req_item_found improvement_found(const struct requirement *preq, const struct universal *source)
struct req_vec_problem * req_vec_get_first_missing_univ(const struct requirement_vector *vec, requirement_vector_number get_num, const void *parent_item)
static enum fc_tristate is_gov_req_active(const struct civ_map *nmap, const struct req_context *context, const struct player *other_player, const struct requirement *req)
static enum fc_tristate is_terrainalter_req_active(const struct civ_map *nmap, const struct req_context *context, const struct player *other_player, const struct requirement *req)
static enum fc_tristate is_tech_req_active(const struct civ_map *nmap, const struct req_context *context, const struct player *other_player, const struct requirement *req)
static enum fc_tristate is_good_req_active(const struct civ_map *nmap, const struct req_context *context, const struct player *other_player, const struct requirement *req)
static bool players_in_same_range(const struct player *pplayer1, const struct player *pplayer2, enum req_range range)
enum req_item_found(* universal_found)(const struct requirement *, const struct universal *)
struct universal universal_by_number(const enum universals_n kind, const int value)
static enum fc_tristate is_achievement_req_active(const struct civ_map *nmap, const struct req_context *context, const struct player *other_player, const struct requirement *req)
enum req_item_found universal_fulfills_requirement(const struct requirement *preq, const struct universal *source)
static enum fc_tristate is_building_req_active(const struct civ_map *nmap, const struct req_context *context, const struct player *other_player, const struct requirement *req)
static bool city_center_contra(const struct requirement *cc_req, const struct requirement *ct_req)
static enum fc_tristate is_unitclassflag_req_active(const struct civ_map *nmap, const struct req_context *context, const struct player *other_player, const struct requirement *req)
static enum req_item_found ustate_found(const struct requirement *preq, const struct universal *source)
bool req_vec_wants_type(const struct requirement_vector *reqs, enum universals_n kind)
static int num_world_buildings_total(const struct impr_type *building)
static enum req_unchanging_status unchanging_citytile(const struct civ_map *nmap, enum req_unchanging_status def, const struct req_context *context, const struct requirement *req)
enum fc_tristate tri_reqs_cb_active(const struct req_context *context, const struct player *other_player, const struct requirement_vector *reqs, struct requirement_vector *maybe_reqs, req_tester_cb tester, void *data, int n_data)
static enum req_item_found output_type_found(const struct requirement *preq, const struct universal *source)
static enum fc_tristate is_minhitpoints_req_active(const struct civ_map *nmap, const struct req_context *context, const struct player *other_player, const struct requirement *req)
struct req_vec_problem * req_vec_get_first_redundant_req(const struct requirement_vector *vec, requirement_vector_number get_num, const void *parent_item)
static enum fc_tristate is_age_req_active(const struct civ_map *nmap, const struct req_context *context, const struct player *other_player, const struct requirement *req)
static enum fc_tristate is_nationgroup_req_active(const struct civ_map *nmap, const struct req_context *context, const struct player *other_player, const struct requirement *req)
static bool is_city_in_tile(const struct tile *ptile, const struct city *pcity)
enum fc_tristate(* is_req_active_cb)(const struct civ_map *nmap, const struct req_context *context, const struct player *other_player, const struct requirement *req)
static enum fc_tristate is_originalowner_req_active(const struct civ_map *nmap, const struct req_context *context, const struct player *other_player, const struct requirement *req)
static enum fc_tristate is_plr_state_req_active(const struct civ_map *nmap, const struct req_context *context, const struct player *other_player, const struct requirement *req)
bool does_req_contradicts_reqs(const struct requirement *req, const struct requirement_vector *vec)
static enum req_item_found government_found(const struct requirement *preq, const struct universal *source)
static enum req_unchanging_status unchanging_world(const struct civ_map *nmap, enum req_unchanging_status def, const struct req_context *context, const struct requirement *req)
static enum fc_tristate is_serversetting_req_active(const struct civ_map *nmap, const struct req_context *context, const struct player *other_player, const struct requirement *req)
static enum fc_tristate is_action_req_active(const struct civ_map *nmap, const struct req_context *context, const struct player *other_player, const struct requirement *req)
bool are_universals_equal(const struct universal *psource1, const struct universal *psource2)
struct req_vec_problem * req_vec_problem_new_transl(int num_suggested_solutions, const char *description, const char *description_translated)
static enum req_item_found unit_activity_found(const struct requirement *preq, const struct universal *source)
static enum fc_tristate is_mintechs_req_active(const struct civ_map *nmap, const struct req_context *context, const struct player *other_player, const struct requirement *req)
static enum fc_tristate is_unitclass_req_active(const struct civ_map *nmap, const struct req_context *context, const struct player *other_player, const struct requirement *req)
enum fc_tristate tri_req_active(const struct req_context *context, const struct player *other_player, const struct requirement *req)
static enum fc_tristate is_terrainflag_req_active(const struct civ_map *nmap, const struct req_context *context, const struct player *other_player, const struct requirement *req)
bool universals_say_everything(struct requirement_vector *reqs, struct universal *unis, size_t n_unis)
static enum fc_tristate is_extra_req_active(const struct civ_map *nmap, const struct req_context *context, const struct player *other_player, const struct requirement *req)
static enum req_item_found nation_found(const struct requirement *preq, const struct universal *source)
const char * universal_type_rule_name(const struct universal *psource)
void universal_found_functions_init(void)
static enum req_item_found unit_class_found(const struct requirement *preq, const struct universal *source)
#define IS_REQ_ACTIVE_VARIANT_ASSERT(_kind)
int universal_number(const struct universal *source)
static enum fc_tristate is_outputtype_req_active(const struct civ_map *nmap, const struct req_context *context, const struct player *other_player, const struct requirement *req)
bool universal_is_mentioned_by_requirements(const struct requirement_vector *reqs, const struct universal *psource)
static enum fc_tristate is_minsize_req_active(const struct civ_map *nmap, const struct req_context *context, const struct player *other_player, const struct requirement *req)
static enum fc_tristate is_diplrel_tile_o_req_active(const struct civ_map *nmap, const struct req_context *context, const struct player *other_player, const struct requirement *req)
static enum req_item_found diplrel_found(const struct requirement *preq, const struct universal *source)
bool req_vec_is_impossible_to_fulfill(const struct requirement_vector *reqs)
static enum fc_tristate is_unitflag_req_active(const struct civ_map *nmap, const struct req_context *context, const struct player *other_player, const struct requirement *req)
bool req_implies_req(const struct requirement *req1, const struct requirement *req2)
void req_copy(struct requirement *dst, const struct requirement *src)
enum req_unchanging_status is_req_unchanging(const struct req_context *context, const struct requirement *req)
static enum fc_tristate is_techflag_req_active(const struct civ_map *nmap, const struct req_context *context, const struct player *other_player, const struct requirement *req)
static bool player_has_ever_built(const struct player *pplayer, const struct impr_type *building)
static enum fc_tristate is_terrainclass_req_active(const struct civ_map *nmap, const struct req_context *context, const struct player *other_player, const struct requirement *req)
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)
static bool nation_contra_group(const struct requirement *nation_req, const struct requirement *group_req)
bool req_is_impossible_to_fulfill(const struct requirement *req)
static bool are_tiles_in_range(const struct tile *tile1, const struct tile *tile2, enum req_range range)
static enum fc_tristate is_minyear_req_active(const struct civ_map *nmap, const struct req_context *context, const struct player *other_player, const struct requirement *req)
static bool are_requirements_opposites(const struct requirement *req1, const struct requirement *req2)
static int num_world_buildings(const struct impr_type *building)
static enum fc_tristate is_minmovefrags_req_active(const struct civ_map *nmap, const struct req_context *context, const struct player *other_player, const struct requirement *req)
static enum fc_tristate is_diplrel_tile_req_active(const struct civ_map *nmap, const struct req_context *context, const struct player *other_player, const struct requirement *req)
static enum req_unchanging_status unchanging_citystatus(const struct civ_map *nmap, enum req_unchanging_status def, const struct req_context *context, const struct requirement *req)
static enum fc_tristate is_minculture_req_active(const struct civ_map *nmap, const struct req_context *context, const struct player *other_player, const struct requirement *req)
const char * universal_name_translation(const struct universal *psource, char *buf, size_t bufsz)
struct universal universal_by_rule_name(const char *kind, const char *value)
static enum fc_tristate is_citystatus_req_active(const struct civ_map *nmap, const struct req_context *context, const struct player *other_player, const struct requirement *req)
bool universals_mean_unfulfilled(struct requirement_vector *reqs, struct universal *unis, size_t n_unis)
struct req_vec_problem * req_vec_suggest_improvement(const struct requirement_vector *vec, requirement_vector_number get_num, const void *parent_item)
static bool impr_contra_genus(const struct requirement *impr_req, const struct requirement *genus_req)
static enum fc_tristate is_unittype_req_active(const struct civ_map *nmap, const struct req_context *context, const struct player *other_player, const struct requirement *req)
#define requirement_diplrel_ereq(_id_, _range_, _present_)
signed char req_vec_num_in_item
req_vec_num_in_item a requirement vectors number in an item.
req_vec_num_in_item(* requirement_vector_number)(const void *parent_item, const struct requirement_vector *vec)
const char *(* requirement_vector_namer)(req_vec_num_in_item number)
#define universal_is_mentioned_by_requirement(preq, psource)
enum req_unchanging_status(* req_unchanging_cond_cb)(const struct civ_map *nmap, enum req_unchanging_status def, const struct req_context *context, const struct requirement *req)
enum fc_tristate(* req_tester_cb)(const struct req_context *context, const struct player *other_player, const struct requirement *req, void *data, int n_data)
#define requirement_vector_iterate_end
struct universal universal_by_number(const enum universals_n kind, const int value)
struct requirement_vector *(* requirement_vector_by_number)(const void *parent_item, req_vec_num_in_item number)
#define requirement_vector_iterate(req_vec, preq)
struct research * research_get(const struct player *pplayer)
enum tech_state research_invention_state(const struct research *presearch, Tech_type_id tech)
bool road_has_flag(const struct road_type *proad, enum road_flag_id flag)
bool is_road_flag_near_tile(const struct civ_map *nmap, const struct tile *ptile, enum road_flag_id flag)
bool is_road_flag_card_near(const struct civ_map *nmap, const struct tile *ptile, enum road_flag_id flag)
bool ssetv_setting_has_value(ssetv val)
ssetv ssetv_by_rule_name(const char *name)
const char * ssetv_rule_name(ssetv val)
const char * ssetv_human_readable(ssetv val, bool present)
enum fc_tristate fc_tristate_or(enum fc_tristate one, enum fc_tristate two)
#define BOOL_TO_TRISTATE(tri)
struct specialist * specialist_by_rule_name(const char *name)
struct specialist * specialist_by_number(const Specialist_type_id id)
Specialist_type_id specialist_number(const struct specialist *sp)
const char * specialist_rule_name(const struct specialist *sp)
const char * specialist_plural_translation(const struct specialist *sp)
struct packet_game_info info
struct packet_calendar_info calendar
bool global_advances[A_LAST]
enum req_unchanging_status unchanging
req_unchanging_cond_cb unchanging_cond
const is_req_active_cb cb
req_vec_num_in_item vector_number
enum req_vec_change_operation operation
int num_suggested_solutions
char description_translated[500]
struct nation_style * style_by_rule_name(const char *name)
struct nation_style * style_by_number(int id)
const char * style_name_translation(const struct nation_style *pstyle)
const char * style_rule_name(const struct nation_style *pstyle)
int style_number(const struct nation_style *pstyle)
int fc_snprintf(char *str, size_t n, const char *format,...)
size_t fc_strlcpy(char *dest, const char *src, size_t n)
int fc_strcasecmp(const char *str0, const char *str1)
size_t fc_strlcat(char *dest, const char *src, size_t n)
int cat_snprintf(char *str, size_t n, const char *format,...)
int fc_vsnprintf(char *str, size_t n, const char *format, va_list ap)
struct advance * advance_by_number(const Tech_type_id atype)
const char * advance_name_translation(const struct advance *padvance)
const char * advance_rule_name(const struct advance *padvance)
struct advance * advance_by_rule_name(const char *name)
Tech_type_id advance_number(const struct advance *padvance)
struct terrain * terrain_by_rule_name(const char *name)
bool is_terrain_class_near_tile(const struct civ_map *nmap, const struct tile *ptile, enum terrain_class tclass)
bool is_terrain_class_card_near(const struct civ_map *nmap, const struct tile *ptile, enum terrain_class tclass)
const char * terrain_class_name_translation(enum terrain_class tclass)
const char * terrain_name_translation(const struct terrain *pterrain)
struct terrain * terrain_by_number(const Terrain_type_id type)
bool terrain_can_support_alteration(const struct terrain *pterrain, enum terrain_alteration alter)
bool is_terrain_card_near(const struct civ_map *nmap, const struct tile *ptile, const struct terrain *pterrain, bool check_self)
const char * terrain_rule_name(const struct terrain *pterrain)
enum terrain_class terrain_type_terrain_class(const struct terrain *pterrain)
bool is_terrain_flag_near_tile(const struct civ_map *nmap, const struct tile *ptile, enum terrain_flag_id flag)
Terrain_type_id terrain_number(const struct terrain *pterrain)
bool is_terrain_flag_card_near(const struct civ_map *nmap, const struct tile *ptile, enum terrain_flag_id flag)
bool is_terrain_near_tile(const struct civ_map *nmap, const struct tile *ptile, const struct terrain *pterrain, bool check_self)
#define terrain_has_flag(terr, flag)
bool tile_has_extra_flag(const struct tile *ptile, enum extra_flag_id flag)
bool tile_has_native_base(const struct tile *ptile, const struct unit_type *punittype)
bool tile_has_road_flag(const struct tile *ptile, enum road_flag_id flag)
struct city * tile_city(const struct tile *ptile)
#define tile_terrain(_tile)
#define tile_continent(_tile)
#define tile_has_extra(ptile, pextra)
#define tile_owner(_tile)
Goods_type_id goods_number(const struct goods_type *pgood)
bool goods_has_flag(const struct goods_type *pgood, enum goods_flag_id flag)
struct goods_type * goods_by_rule_name(const char *name)
const char * goods_rule_name(struct goods_type *pgood)
const char * goods_name_translation(struct goods_type *pgood)
struct goods_type * goods_by_number(Goods_type_id id)
bool goods_can_be_provided(const struct city *pcity, const struct goods_type *pgood, struct unit *punit)
bool city_receives_goods(const struct city *pcity, const struct goods_type *pgood)
#define trade_partners_iterate_end
#define trade_partners_iterate(c, p)
const struct unit_type * utype
struct nation_style * style
struct specialist * specialist
enum impr_genus_id impr_genus
enum citytile_type citytile
struct nation_group * nationgroup
struct extra_type * extra
enum wrap_flag wrap_property
enum plrstate_type plrstate
struct nation_type * nation
struct government * govern
struct nation_type * origowner
enum impr_flag_id impr_flag
enum citystatus_type citystatus
const struct impr_type * building
struct achievement * achievement
enum unit_activity activity
enum ustate_prop unit_state
Output_type_id outputtype
enum topo_flag topo_property
struct unit_class * uclass
struct nation_type * nationality
enum plr_flag_id plr_flag
int get_transporter_occupancy(const struct unit *ptrans)
#define unit_list_iterate(unitlist, punit)
#define unit_list_iterate_end
const char * uclass_name_translation(const struct unit_class *pclass)
const struct unit_type * unit_type_get(const struct unit *punit)
struct unit_type * unit_type_by_rule_name(const char *name)
bool uclass_flag_is_in_use(enum unit_class_flag_id ucflag)
struct unit_class * uclass_by_number(const Unit_Class_id id)
const char * utype_rule_name(const struct unit_type *punittype)
struct unit_type * utype_by_number(const Unit_type_id id)
const char * uclass_rule_name(const struct unit_class *pclass)
Unit_type_id utype_number(const struct unit_type *punittype)
struct unit_class * unit_class_by_rule_name(const char *s)
bool utype_flag_is_in_use(enum unit_type_flag_id uflag)
int utype_build_shield_cost(const struct city *pcity, const struct player *pplayer, const struct unit_type *punittype)
Unit_Class_id uclass_number(const struct unit_class *pclass)
const char * utype_name_translation(const struct unit_type *punittype)
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)
bool victory_enabled(enum victory_condition_type victory)