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) {
478 if (
source->value.min_cities > 0) {
496 if (
source->value.specialist) {
502 if (
source->value.minsize > 0) {
508 if (
source->value.minculture > 0) {
514 if (
source->value.minforeignpct > 0) {
526 if (0 <=
source->value.max_tile_units) {
531 source->value.terrainclass
555 if (
source->value.mincalfrag >= 0) {
579 source->value.terrainalter
619 if (0 <=
source->value.distance_sq) {
625 if (0 <
source->value.region_tiles) {
920 return source->value.techflag;
931 return source->value.impr_genus;
933 return source->value.impr_flag;
935 return source->value.plr_flag;
943 return source->value.terrainflag;
957 return source->value.diplrel;
961 return source->value.unitflag;
965 return source->value.unitclassflag;
967 return source->value.minveteran;
969 return source->value.unit_state;
971 return source->value.activity;
973 return source->value.minmoves;
975 return source->value.min_hit_points;
979 return source->value.form_age;
981 return source->value.min_techs;
983 return source->value.min_cities;
987 return source->value.outputtype;
991 return source->value.minsize;
993 return source->value.minculture;
995 return source->value.minforeignpct;
997 return source->value.ai_level;
999 return source->value.max_tile_units;
1001 return source->value.terrainclass;
1003 return source->value.roadflag;
1005 return source->value.extraflag;
1007 return source->value.minyear;
1009 return source->value.mincalfrag;
1011 return source->value.topo_property;
1013 return source->value.wrap_property;
1015 return source->value.ssetval;
1017 return source->value.terrainalter;
1019 return source->value.citytile;
1021 return source->value.citystatus;
1023 return source->value.plrstate;
1028 return source->value.latitude;
1030 return source->value.distance_sq;
1032 return source->value.region_tiles;
1034 return source->value.tilerel;
1092 const char *error =
NULL;
1098 error =
"bad type or name";
1394 error =
"bad range";
1476 error =
"bad 'survives'";
1481 log_error(
"Invalid requirement %s | %s | %s | %s | %s: %s",
1483 present ?
"present" :
"", value, error);
1580 return (
impr_req->source.value.building->genus
1586 return (
impr_req->source.value.building->genus
1667 switch (
ct_req->source.value.citytile) {
1685 &&
ct_req->source.value.citytile
1881#define EXTRACT_INFO(req) \
1882 if (req->present) { \
1883 if (req->source.kind == VUT_MINLATITUDE) { \
1885 minimum = MAX(minimum, req->source.value.latitude); \
1888 maximum = MIN(maximum, req->source.value.latitude); \
1891 covered_range = MAX(covered_range, req->range); \
1892 if (req->source.kind == VUT_MINLATITUDE) { \
1894 maximum = MIN(maximum, req->source.value.latitude - 1); \
1897 minimum = MAX(minimum, req->source.value.latitude + 1); \
1906 return (maximum < minimum
2025 switch (
other->source.value.tilerel) {
2030 return (!
other->present);
2128#define IS_REQ_ACTIVE_VARIANT_ASSERT(_kind) \
2130 fc_assert_ret_val(req != nullptr, TRI_MAYBE); \
2131 fc_assert_ret_val(req->source.kind == _kind, TRI_MAYBE); \
2132 fc_assert(context != nullptr); \
2133 fc_assert(other_context != nullptr); \
2165 log_error(
"World-ranged requirements are only supported for wonders.");
2178 log_error(
"World-ranged requirements are only supported for wonders.");
2201 log_error(
"Player-ranged requirements are only supported for wonders.");
2215 log_error(
"Player-ranged requirements are only supported for wonders.");
2235 log_error(
"Island-ranged requirements are only supported for wonders.");
2272 switch (req->
range) {
2301 log_error(
"Surviving requirements are only supported at "
2302 "World/Alliance/Team/Player ranges.");
2311 switch (req->
range) {
2339 continent, building)
2372 if (
context->building == building) {
2466 switch (req->
range) {
2513 switch (req->
range) {
2554 switch (req->
range) {
2605 switch (req->
range) {
2607 if (
context->player !=
nullptr) {
2616 if (
context->player ==
nullptr) {
2630 if (
context->player ==
nullptr) {
2672 switch (req->
range) {
2674 if (
context->player !=
nullptr) {
2683 if (
context->player ==
nullptr) {
2702 if (
context->player ==
nullptr) {
2744 switch (req->
range) {
2818 switch (req->
range) {
2890 switch (req->
range) {
2960 switch (req->
range) {
3058 switch (req->
range) {
3172 const struct terrain *pterrain;
3178 switch (req->
range) {
3199 if (pterrain !=
NULL) {
3212 if (pterrain !=
NULL) {
3276 switch (req->
range) {
3378 switch (req->
range) {
3486 switch (req->
range) {
3591 switch (req->
range) {
3691 switch (req->
range) {
3778 switch (req->
range) {
3814 switch (req->
range) {
3850 &&
context->player->ai_common.skill_level
3875 switch (req->
range) {
3937 switch (req->
range) {
3995 switch (req->
range) {
4069 switch (req->
range) {
4102 const struct player *other_player,
4218 const struct player *other_player,
4302 switch (req->
range) {
4311 if (
context->tile ==
nullptr) {
4382 switch (req->
range) {
4391 if (
context->tile ==
nullptr) {
4462 switch (req->
range) {
4471 if (
context->tile ==
nullptr) {
4542 switch (req->
range) {
4551 if (
context->tile ==
nullptr) {
4623 "Unsupported range \"%s\"",
4689 "Unsupported range \"%s\"",
4706 switch (
context->unit->activity) {
4765 <=
context->unit->moves_left);
4809 switch (req->
range) {
4858 switch (req->
range) {
4891 }
else if (cont < 0) {
4945 "Invalid range %d for tile relation \"%s\" req",
4982 "Invalid range %d for tile relation \"%s\" req",
5020 "Invalid range %d for tile relation \"%s\" req",
5051 "Invalid range %d for tile relation \"%s\" req",
5095 "Illegal value %d for tile relationship requirement.",
5140 switch (req->
range) {
5181 switch (req->
range) {
5221 switch (req->
range) {
5261 switch (req->
range) {
5315 switch (req->
range) {
5406 switch (req->
range) {
5414 if (0 == tc ||
ukt) {
5417 for (
int i = 0;
i <
n;
i++) {
5442 for (
int i = 0;
i <
n;
i++) {
5466 for (
int i = 0;
i <
n;
i++) {
5496 log_error(
"is_req_active(): citytile %d not supported.",
5525 switch (citystatus) {
5527 switch (req->
range) {
5571 switch (req->
range) {
5578 if (
context->city->had_famine) {
5612 switch (req->
range) {
5619 if (
context->city->anarchy > 0) {
5653 switch (req->
range) {
5660 if (
context->city->rapture > 0) {
5694 switch (req->
range) {
5739 log_error(
"is_req_active(): citystatus %d not supported.",
5812 context->city->counter_values[
5894 switch (req->
range) {
5948 "Illegal range %d for latitude requirement.", req->
range);
5969 switch (req->
range) {
5983 "Illegal range %d for max squared distance requirement.",
6007 switch (req->
range) {
6010 if (
context->tile ==
nullptr) {
6013 ?
nmap->num_cardinal_dirs
6014 :
nmap->num_valid_dirs);
6055 }
else if (cont < 0) {
6065 "Illegal range %d for max region tiles requirement.",
6301 log_error(
"tri_req_present(): invalid source kind %d.",
6452 switch (req->
range) {
6606 "Invalid source kind %d.", req->
source.
kind);
6697 if (
preq->present &&
preq->source.kind == kind) {
6989 sizeof(
out->description_translated));
6994 for (
i = 0;
i <
out->num_suggested_solutions;
i++) {
6997 out->suggested_solutions[
i].vector_number = -1;
6998 out->suggested_solutions[
i].req.source.kind =
VUT_NONE;
7013 const char *descr, ...)
7040 issue->num_suggested_solutions = 0;
7087 N_(
"Requirements {%s} and {%s} contradict each other."),
7169 if (
preq->present) {
7179 N_(
"Requirement {%s} requires %s but it will never be"
7196 N_(
"Requirement {%s} mentions %s but it will never be there."),
7258 N_(
"Requirements {%s} and {%s} are the same."),
7463 static char buffer[10];
7739 Q_(
"?utflag:\"%s\" units"),
7752 Q_(
"?ucflag:\"%s\" units"),
7754 psource->value.unitclassflag));
7762 switch (
psource->value.unit_state) {
7771 _(
"On livable tile"));
7785 _(
"On native tile"));
7791 _(
"In native extra"));
7800 "Invalid unit state property.");
7817 psource->value.min_hit_points);
7857 psource->value.minforeignpct);
7867 "<=%d units",
psource->value.max_tile_units),
7868 psource->value.max_tile_units);
7878 Q_(
"?terrflag:\"%s\" terrain"),
7885 Q_(
"?roadflag:\"%s\" road"),
7891 Q_(
"?extraflag:\"%s\" extra"),
7924 switch (
psource->value.citytile) {
7951 switch (
psource->value.citystatus) {
7975 switch (
psource->value.tilerel) {
8035 switch (target->
kind) {
8056 bool changed =
FALSE;
8169 "No req item found function for %s",
8193 "No req item found function for %s",
8201 if (
preq->present) {
8206 if (
preq->present) {
8233 log_error(
"Unhandled item_found value");
8245 switch (
preq->source.kind) {
8305 switch (
preq->source.kind) {
8308 if (
source->value.building ==
preq->source.value.building) {
8313 if (
source->value.building->genus ==
preq->source.value.impr_genus) {
8319 preq->source.value.impr_flag)) {
8338 switch (
preq->source.kind) {
8361 switch (
preq->source.kind) {
8390 switch (
preq->source.kind) {
8408 switch (
preq->source.kind) {
8419 preq->source.value.terrainalter)
8436 switch (
preq->source.kind) {
8438 return (
source->value.citytile ==
preq->source.value.citytile
8456 switch (
preq->source.kind) {
8504 if (
preq->source.value.diplrel ==
source->value.diplrel) {
8545 switch (
preq->source.kind) {
8566 switch (
source->value.unit_state) {
8577 if (
source->value.unit_state ==
preq->source.value.unit_state) {
8629 const int max_value)
8633 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 *paction)
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)
const char * action_id_rule_name(action_id act_id)
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
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 const struct action *paction struct unit struct city * pcity
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_normal(message,...)
#define log_error(message,...)
#define fc_assert_ret_val_msg(condition, val, message,...)
int sq_map_distance(const struct tile *tile0, const struct tile *tile1)
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 get_island_surrounder(Continent_id id)
int get_lake_surrounder(Continent_id id)
int map_distance(const struct tile *tile0, const struct tile *tile1)
#define current_topo_has_flag(flag)
#define range_adjc_iterate(nmap, center_tile, range, itr_tile)
#define MAP_MAX_REAL_LATITUDE(_nmap)
#define range_adjc_iterate_end
#define square_iterate(nmap, center_tile, radius, tile_itr)
#define cardinal_adjc_iterate_end
#define adjc_iterate(nmap, center_tile, itr_tile)
#define is_whole_continent_known(cont)
#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 is_whole_ocean_known(ocean)
#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 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_unitclass_req_active(const struct civ_map *nmap, const struct req_context *context, const struct req_context *other_context, const struct requirement *req)
static enum fc_tristate is_unitflag_req_active(const struct civ_map *nmap, const struct req_context *context, const struct req_context *other_context, 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)
int universal_build_shield_cost(const struct city *pcity, const struct universal *target)
static enum fc_tristate is_terrainflag_req_active(const struct civ_map *nmap, const struct req_context *context, const struct req_context *other_context, const struct requirement *req)
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 fc_tristate is_action_req_active(const struct civ_map *nmap, const struct req_context *context, const struct req_context *other_context, const struct requirement *req)
static enum req_item_found unit_type_found(const struct requirement *preq, const struct universal *source)
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_tech_req_active(const struct civ_map *nmap, const struct req_context *context, const struct req_context *other_context, const struct requirement *req)
static enum fc_tristate is_none_req_active(const struct civ_map *nmap, const struct req_context *context, const struct req_context *other_context, const struct requirement *req)
static int num_continent_buildings(const struct player *pplayer, int continent, const struct impr_type *building)
static enum fc_tristate is_minveteran_req_active(const struct civ_map *nmap, const struct req_context *context, const struct req_context *other_context, const struct requirement *req)
const char * req_to_fstring(const struct requirement *req, struct astring *astr)
static enum fc_tristate is_counter_req_active(const struct civ_map *nmap, const struct req_context *context, const struct req_context *other_context, 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)
enum fc_tristate tri_req_active(const struct req_context *context, const struct req_context *other_context, 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)
enum fc_tristate tri_reqs_cb_active(const struct req_context *context, const struct req_context *other_context, const struct requirement_vector *reqs, struct requirement_vector *maybe_reqs, req_tester_cb tester, void *data, int n_data)
static enum fc_tristate is_minsize_req_active(const struct civ_map *nmap, const struct req_context *context, const struct req_context *other_context, const struct requirement *req)
static enum fc_tristate is_ai_req_active(const struct civ_map *nmap, const struct req_context *context, const struct req_context *other_context, 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_max_distance_sq_req_active(const struct civ_map *nmap, const struct req_context *context, const struct req_context *other_context, 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 fc_tristate is_minculture_req_active(const struct civ_map *nmap, const struct req_context *context, const struct req_context *other_context, const struct requirement *req)
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)
static enum fc_tristate is_terrain_req_active(const struct civ_map *nmap, const struct req_context *context, const struct req_context *other_context, const struct requirement *req)
bool are_requirements_equal(const struct requirement *req1, const struct requirement *req2)
static enum fc_tristate is_minforeignpct_req_active(const struct civ_map *nmap, const struct req_context *context, const struct req_context *other_context, 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 req_context *other_context, const struct requirement *req)
static enum fc_tristate is_minyear_req_active(const struct civ_map *nmap, const struct req_context *context, const struct req_context *other_context, const struct requirement *req)
static enum req_item_found extra_type_found(const struct requirement *preq, const struct universal *source)
static enum fc_tristate is_buildingflag_req_active(const struct civ_map *nmap, const struct req_context *context, const struct req_context *other_context, const struct requirement *req)
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)
const char * req_vec_change_translation(const struct req_vec_change *change, const requirement_vector_namer namer)
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)
static enum fc_tristate is_wrap_req_active(const struct civ_map *nmap, const struct req_context *context, const struct req_context *other_context, const struct requirement *req)
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)
static enum fc_tristate is_latitude_req_active(const struct civ_map *nmap, const struct req_context *context, const struct req_context *other_context, const struct requirement *req)
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)
static enum fc_tristate is_nationality_req_active(const struct civ_map *nmap, const struct req_context *context, const struct req_context *other_context, const struct requirement *req)
const char * universal_rule_name(const struct universal *psource)
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)
bool universal_replace_in_req_vec(struct requirement_vector *reqs, const struct universal *to_replace, const struct universal *replacement)
static enum req_item_found action_found(const struct requirement *preq, const struct universal *source)
static enum fc_tristate is_minmovefrags_req_active(const struct civ_map *nmap, const struct req_context *context, const struct req_context *other_context, const struct requirement *req)
static enum fc_tristate is_diplrel_req_active(const struct civ_map *nmap, const struct req_context *context, const struct req_context *other_context, const struct requirement *req)
bool are_requirements_contradictions(const struct requirement *req1, const struct requirement *req2)
static enum fc_tristate is_maxunitsontile_req_active(const struct civ_map *nmap, const struct req_context *context, const struct req_context *other_context, const struct requirement *req)
struct req_vec_problem * req_vec_problem_new(int num_suggested_solutions, const char *descr,...)
static enum fc_tristate is_buildinggenus_req_active(const struct civ_map *nmap, const struct req_context *context, const struct req_context *other_context, 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_mintechs_req_active(const struct civ_map *nmap, const struct req_context *context, const struct req_context *other_context, const struct requirement *req)
bool is_req_active(const struct req_context *context, const struct req_context *other_context, const struct requirement *req, const enum req_problem_type prob_type)
static enum fc_tristate is_originalowner_req_active(const struct civ_map *nmap, const struct req_context *context, const struct req_context *other_context, const struct requirement *req)
static bool are_bounds_contradictions(int bound1, bool is_upper1, int bound2, bool is_upper2)
static enum fc_tristate is_diplrel_tile_req_active(const struct civ_map *nmap, const struct req_context *context, const struct req_context *other_context, const struct requirement *req)
bool universal_is_legal_in_requirement(const struct universal *univ)
enum fc_tristate default_tester_cb(const struct req_context *context, const struct req_context *other_context, const struct requirement *req, void *data, int n_data)
static enum fc_tristate tri_req_present(const struct civ_map *nmap, const struct req_context *context, const struct req_context *other_context, 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_achievement_req_active(const struct civ_map *nmap, const struct req_context *context, const struct req_context *other_context, 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)
bool are_reqs_active(const struct req_context *context, const struct req_context *other_context, const struct requirement_vector *reqs, const enum req_problem_type prob_type)
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 req_item_found mincities_found(const struct requirement *preq, const struct universal *source)
static enum fc_tristate is_extraflag_req_active(const struct civ_map *nmap, const struct req_context *context, const struct req_context *other_context, const struct requirement *req)
enum req_unchanging_status is_req_preventing(const struct req_context *context, const struct req_context *other_context, const struct requirement *req, enum req_problem_type prob_type)
static enum fc_tristate is_plr_state_req_active(const struct civ_map *nmap, const struct req_context *context, const struct req_context *other_context, 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 *)
static enum fc_tristate is_terrainclass_req_active(const struct civ_map *nmap, const struct req_context *context, const struct req_context *other_context, const struct requirement *req)
struct universal universal_by_number(const enum universals_n kind, const int value)
static enum fc_tristate is_roadflag_req_active(const struct civ_map *nmap, const struct req_context *context, const struct req_context *other_context, 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 req_context *other_context, const struct requirement *req)
static enum fc_tristate is_age_req_active(const struct civ_map *nmap, const struct req_context *context, const struct req_context *other_context, const struct requirement *req)
bool are_reqs_active_ranges(const enum req_range min_range, const enum req_range max_range, const struct req_context *context, const struct req_context *other_context, const struct requirement_vector *reqs, const enum req_problem_type prob_type)
static enum fc_tristate is_gov_req_active(const struct civ_map *nmap, const struct req_context *context, const struct req_context *other_context, 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 req_context *other_context, const struct requirement *req)
static enum fc_tristate is_good_req_active(const struct civ_map *nmap, const struct req_context *context, const struct req_context *other_context, const struct requirement *req)
static enum fc_tristate is_unitstate_req_active(const struct civ_map *nmap, const struct req_context *context, const struct req_context *other_context, const struct requirement *req)
static bool city_center_contra(const struct requirement *cc_req, const struct requirement *ct_req)
static enum req_item_found ustate_found(const struct requirement *preq, const struct universal *source)
static enum fc_tristate is_terrainalter_req_active(const struct civ_map *nmap, const struct req_context *context, const struct req_context *other_context, const struct requirement *req)
static enum fc_tristate is_unittype_req_active(const struct civ_map *nmap, const struct req_context *context, const struct req_context *other_context, const struct requirement *req)
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)
static enum req_item_found output_type_found(const struct requirement *preq, const struct universal *source)
static enum fc_tristate is_citystatus_req_active(const struct civ_map *nmap, const struct req_context *context, const struct req_context *other_context, const struct requirement *req)
static enum fc_tristate is_tile_rel_req_active(const struct civ_map *nmap, const struct req_context *context, const struct req_context *other_context, 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_mincities_req_active(const struct civ_map *nmap, const struct req_context *context, const struct req_context *other_context, const struct requirement *req)
static bool is_city_in_tile(const struct tile *ptile, const struct city *pcity)
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 fc_tristate does_region_surrounder_match(Continent_id cont, Continent_id surrounder)
static enum fc_tristate is_extra_req_active(const struct civ_map *nmap, const struct req_context *context, const struct req_context *other_context, const struct requirement *req)
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_mincalfrag_req_active(const struct civ_map *nmap, const struct req_context *context, const struct req_context *other_context, const struct requirement *req)
static enum fc_tristate is_activity_req_active(const struct civ_map *nmap, const struct req_context *context, const struct req_context *other_context, const struct requirement *req)
bool are_universals_equal(const struct universal *psource1, const struct universal *psource2)
static enum fc_tristate is_max_region_tiles_req_active(const struct civ_map *nmap, const struct req_context *context, const struct req_context *other_context, const struct requirement *req)
struct req_vec_problem * req_vec_problem_new_transl(int num_suggested_solutions, const char *description, const char *description_translated)
static enum fc_tristate is_nationgroup_req_active(const struct civ_map *nmap, const struct req_context *context, const struct req_context *other_context, const struct requirement *req)
static enum req_item_found unit_activity_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 req_context *other_context, const struct requirement *req)
enum fc_tristate tri_req_active_turns(int pass, int period, const struct req_context *context, const struct req_context *other_context, const struct requirement *req)
static enum fc_tristate is_outputtype_req_active(const struct civ_map *nmap, const struct req_context *context, const struct req_context *other_context, const struct requirement *req)
bool universals_say_everything(struct requirement_vector *reqs, struct universal *unis, size_t n_unis)
static enum fc_tristate is_unitclassflag_req_active(const struct civ_map *nmap, const struct req_context *context, const struct req_context *other_context, 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 fc_tristate is_style_req_active(const struct civ_map *nmap, const struct req_context *context, const struct req_context *other_context, const struct requirement *req)
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_techflag_req_active(const struct civ_map *nmap, const struct req_context *context, const struct req_context *other_context, const struct requirement *req)
bool universal_is_mentioned_by_requirements(const struct requirement_vector *reqs, const struct universal *psource)
static enum fc_tristate is_citytile_req_active(const struct civ_map *nmap, const struct req_context *context, const struct req_context *other_context, 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)
bool req_implies_req(const struct requirement *req1, const struct requirement *req2)
static enum fc_tristate is_specialist_req_active(const struct civ_map *nmap, const struct req_context *context, const struct req_context *other_context, const struct requirement *req)
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 bool player_has_ever_built(const struct player *pplayer, const struct impr_type *building)
enum fc_tristate(* is_req_active_cb)(const struct civ_map *nmap, const struct req_context *context, const struct req_context *other_context, const struct requirement *req)
static bool nation_contra_group(const struct requirement *nation_req, const struct requirement *group_req)
static enum fc_tristate is_serversetting_req_active(const struct civ_map *nmap, const struct req_context *context, const struct req_context *other_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 req_context *other_context, const struct requirement *req)
static enum fc_tristate is_nation_req_active(const struct civ_map *nmap, const struct req_context *context, const struct req_context *other_context, const struct requirement *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 bool are_requirements_opposites(const struct requirement *req1, const struct requirement *req2)
static enum fc_tristate is_form_age_req_active(const struct civ_map *nmap, const struct req_context *context, const struct req_context *other_context, const struct requirement *req)
static int num_world_buildings(const struct impr_type *building)
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_topology_req_active(const struct civ_map *nmap, const struct req_context *context, const struct req_context *other_context, 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 req_context *other_context, 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)
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)
enum fc_tristate(* req_tester_cb)(const struct req_context *context, const struct req_context *other_context, const struct requirement *req, void *data, int n_data)
#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)
#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]
const struct unit_type * utype
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)
bool advance_has_flag(Tech_type_id tech, enum tech_flag_id flag)
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)
bool goods_can_be_provided(const struct city *pcity, const struct goods_type *pgood, const struct unit *punit)
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 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
enum tilerel_type tilerel
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)
bool unit_has_class_flag(const struct unit *punit, enum unit_class_flag_id flag)
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_class * unit_class_get(const struct unit *punit)
struct unit_type * utype_by_number(const Unit_type_id id)
bool unit_has_type_flag(const struct unit *punit, enum unit_type_flag_id flag)
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)