145 case VUT_IMPROVEMENT:
169 auto *peffect =
new effect;
171 peffect->value =
value;
172 peffect->multiplier = pmul;
174 requirement_vector_init(&peffect->reqs);
207 requirement_vector_append(&peffect->
reqs, req);
210 effect_list_append(eff_list, peffect);
253 requirement_vector_free(&peffect->reqs);
257 effect_list_destroy(tracker_list);
265 effect_list_destroy(plist);
274 effect_list_destroy(plist);
283 effect_list_destroy(plist);
292 effect_list_destroy(plist);
315 if (peffect->type == type && peffect->value > 0) {
316 if (for_uni ==
nullptr
319 value += peffect->value;
344 if (peffect->type == type && peffect->value < 0) {
345 if (for_uni ==
nullptr
348 value += peffect->value;
376 bool effect_applies =
true;
377 bool first_source_mentioned =
false;
379 if (peffect->multiplier) {
388 bool req_mentioned_a_source =
false;
390 for (i = 0; effect_applies && i < n_unis; i++) {
397 req_mentioned_a_source =
true;
400 effect_applies =
false;
404 req_mentioned_a_source =
true;
407 first_source_mentioned =
true;
412 effect_applies =
false;
417 if (!req_mentioned_a_source) {
420 effect_applies =
false;
422 if (!effect_applies) {
429 if (!first_source_mentioned) {
434 if (effect_applies) {
435 value += peffect->value;
455 peffect =
effect_new(packet->effect_type, packet->effect_value, pmul);
457 for (i = 0; i < packet->reqs_count; i++) {
470 struct packet_ruleset_effect effect_packet;
473 effect_packet.effect_type = peffect->type;
474 effect_packet.effect_value = peffect->value;
475 if (peffect->multiplier) {
476 effect_packet.has_multiplier =
true;
479 effect_packet.has_multiplier =
false;
480 effect_packet.multiplier = 0;
486 effect_packet.reqs[counter++] = *req;
489 effect_packet.reqs_count = counter;
491 lsend_packet_ruleset_effect(dest, &effect_packet);
505 enum effect_type effect_type)
511 .kind = VUT_IMPROVEMENT};
520 if (peffect->type == effect_type) {
536 const struct player *target_player,
const struct player *other_player,
537 const struct city *target_city,
const struct impr_type *target_building,
538 const struct tile *target_tile,
const struct unit *target_unit,
550 target_building, target_tile, target_unit,
551 target_unittype, target_output, target_specialist,
570 struct effect_list *plist;
572 .kind = VUT_IMPROVEMENT};
589 nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
590 peffect, prob_type)) {
612 struct effect_list *plist,
const struct player *target_player,
613 const struct player *other_player,
const struct city *target_city,
614 const struct impr_type *target_building,
const struct tile *target_tile,
615 const struct unit *target_unit,
const struct unit_type *target_unittype,
618 const struct action *target_action,
enum effect_type effect_type,
619 enum vision_layer vision_layer,
enum national_intelligence nintel)
628 target_building, target_tile, target_unit,
629 target_unittype, target_output, target_specialist,
631 vision_layer, nintel)) {
635 if (peffect->multiplier) {
637 bonus += (peffect->value
639 peffect->multiplier))
643 bonus += peffect->value;
647 effect_list_append(plist, peffect);
666 nullptr,
nullptr,
nullptr,
nullptr,
667 nullptr,
nullptr,
nullptr, effect_type);
674 enum effect_type effect_type)
681 nullptr,
nullptr,
nullptr,
nullptr,
682 nullptr,
nullptr,
nullptr, effect_type);
689 enum vision_layer vlayer)
697 nullptr,
nullptr,
nullptr,
nullptr,
nullptr, effect_type, vlayer);
706 enum effect_type effect_type)
712 nullptr,
city_owner(pcity),
nullptr, pcity,
nullptr,
nullptr,
nullptr,
713 nullptr, poutput, pspecialist,
nullptr, effect_type);
729 const struct tile *ptile,
731 enum effect_type effect_type)
735 nullptr, ptile,
nullptr,
nullptr, poutput,
736 nullptr,
nullptr, effect_type);
748 enum effect_type effect_type)
753 ptile,
nullptr,
nullptr, poutput,
nullptr,
754 nullptr, effect_type);
762 enum effect_type effect_type)
772 nullptr,
nullptr,
nullptr,
nullptr,
773 poutput,
nullptr,
nullptr, effect_type);
780 const struct player *pother,
781 enum national_intelligence nintel,
782 enum effect_type effect_type)
793 nullptr, pplayer, pother,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
794 nullptr,
nullptr,
nullptr, effect_type, V_COUNT, nintel);
802 enum effect_type effect_type)
812 nullptr,
nullptr,
nullptr,
nullptr,
813 poutput,
nullptr,
nullptr, effect_type);
821 enum effect_type effect_type)
829 building,
nullptr,
nullptr,
nullptr,
830 nullptr,
nullptr,
nullptr, effect_type);
842 const struct tile *ptile,
844 enum effect_type effect_type,
845 enum vision_layer vision_layer)
855 if (ptile !=
nullptr) {
862 nullptr, pplayer,
nullptr, pcity,
nullptr, ptile,
nullptr, punittype,
863 nullptr,
nullptr,
nullptr, effect_type, vision_layer);
880 nullptr, effect_type);
890 const struct player *pplayer,
891 enum effect_type effect_type)
899 nullptr,
nullptr,
nullptr,
nullptr,
900 nullptr,
nullptr, effect_type);
910 const struct city *pcity,
912 enum effect_type effect_type)
920 nullptr,
nullptr,
nullptr,
nullptr,
921 poutput,
nullptr,
nullptr, effect_type);
934 enum effect_type effect_type,
943 pcity, effect_type, prob_type);
955 const struct city *pcity,
956 enum effect_type effect_type,
960 .kind = VUT_IMPROVEMENT};
971 if (peffect->type != effect_type) {
977 if (VUT_IMPROVEMENT == preq->source.kind
978 && preq->source.value.building == pimprove) {
979 present = preq->present;
984 nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
985 nullptr, preq, prob_type)) {
994 power += peffect->value;
996 power -= peffect->value;
1023 if (buf[0] !=
'\0') {
1026 if (!preq->present) {
1027 fc_strlcat(buf,
Q_(
"?req-list-separator:not "), buf_len);
1031 buf_len - qstrlen(buf));
1048 psv.append(req_text);
1061 case EFT_TECH_PARASITE:
1062 return QString(
PL_(
"%1 player",
"%1 players", value)).arg(value);
1064 case EFT_UPGRADE_UNIT:
1065 case EFT_MARTIAL_LAW_MAX:
1067 return QString(
PL_(
"%1 unit",
"%1 units", value)).arg(value);
1068 case EFT_OUTPUT_BONUS:
1069 case EFT_OUTPUT_BONUS_2:
1070 case EFT_OUTPUT_PER_TILE:
1071 case EFT_OUTPUT_WASTE_PCT:
1072 case EFT_GROWTH_FOOD:
1073 case EFT_HEALTH_PCT:
1074 case EFT_POLLU_POP_PCT:
1075 case EFT_POLLU_POP_PCT_2:
1076 case EFT_POLLU_PROD_PCT:
1077 case EFT_POLLU_TRADE_PCT:
1078 case EFT_INCITE_COST_PCT:
1079 case EFT_SPY_RESISTANT:
1080 case EFT_VETERAN_COMBAT:
1082 case EFT_HP_REGEN_MIN:
1083 case EFT_TRADEROUTE_PCT:
1084 case EFT_DEFEND_BONUS:
1085 case EFT_CIVIL_WAR_CHANCE:
1086 case EFT_MIGRATION_PCT:
1088 case EFT_OUTPUT_WASTE:
1089 case EFT_UPGRADE_PRICE_PCT:
1090 case EFT_SHIELD2GOLD_FACTOR:
1091 case EFT_IMPR_BUILD_COST_PCT:
1092 case EFT_IMPR_BUY_COST_PCT:
1093 case EFT_NUKE_IMPROVEMENT_PCT:
1094 case EFT_UNIT_BUILD_COST_PCT:
1095 case EFT_UNIT_BUY_COST_PCT:
1096 case EFT_ENEMY_CITIZEN_UNHAPPY_PCT:
1097 case EFT_IRRIGATION_PCT:
1098 case EFT_MINING_PCT:
1099 case EFT_OUTPUT_TILE_PUNISH_PCT:
1100 case EFT_UNIT_BRIBE_COST_PCT:
1101 case EFT_RETIRE_PCT:
1102 case EFT_ACTION_ODDS_PCT:
1103 case EFT_OUTPUT_WASTE_BY_REL_DISTANCE:
1105 case EFT_SABOTEUR_RESISTANT:
1106 case EFT_ATTACK_BONUS:
1107 case EFT_CONQUEST_TECH_PCT:
1108 case EFT_FORTIFY_DEFENSE_BONUS:
1109 case EFT_MAPS_STOLEN_PCT:
1110 case EFT_UNIT_SHIELD_VALUE_PCT:
1111 case EFT_BOMBARD_LIMIT_PCT:
1112 case EFT_NUKE_INFRASTRUCTURE_PCT:
1113 case EFT_GROWTH_SURPLUS_PCT:
1115 return QString(
PL_(
"%1%",
"%1%", value)).arg(value);
1116 case EFT_MAX_STOLEN_GOLD_PM:
1117 case EFT_THIEFS_SHARE_PM:
1119 return QString(
PL_(
"%1‰",
"%1‰", value)).arg(value);
1120 case EFT_FORCE_CONTENT:
1121 case EFT_MAKE_CONTENT:
1122 case EFT_MAKE_CONTENT_MIL:
1123 case EFT_MAKE_HAPPY:
1125 case EFT_MARTIAL_LAW_EACH:
1126 case EFT_CITY_UNHAPPY_SIZE:
1127 return QString(
PL_(
"%1 citizen",
"%1 citizens", value)).arg(value);
1128 case EFT_GIVE_IMM_TECH:
1129 return QString(
PL_(
"%1 tech",
"%1 techs", value)).arg(value);
1130 case EFT_MOVE_BONUS:
1131 case EFT_ILLEGAL_ACTION_MOVE_COST:
1132 case EFT_ACTION_SUCCESS_MOVE_COST:
1133 case EFT_ACTION_SUCCESS_TARGET_MOVE_COST:
1135 return QString(
PL_(
"%1 MP",
"%1 MP", value)).arg(value);
1136 case EFT_UNIT_RECOVER:
1137 case EFT_ILLEGAL_ACTION_HP_COST:
1139 return QString(
PL_(
"%1 HP",
"%1 HP", value)).arg(value);
1140 case EFT_UPKEEP_FREE:
1141 return QString(
PL_(
"%1 building",
"%1 buildings", value)).arg(value);
1142 case EFT_VETERAN_BUILD:
1144 return QString(
PL_(
"%1 level",
"%1 levels", value)).arg(value);
1145 case EFT_CITY_VISION_RADIUS_SQ:
1146 case EFT_UNIT_VISION_RADIUS_SQ:
1147 case EFT_CITY_RADIUS_SQ:
1149 return QString(
PL_(
"%1 sq. tile",
"%1 sq. tiles", value)).arg(value);
1150 case EFT_GAIN_AI_LOVE:
1152 return QString(
PL_(
"%1 love",
"%1 love", value)).arg(value);
1153 case EFT_TURN_YEARS:
1155 return QString(
PL_(
"%1 yr/turn",
"%1 yr/turn", value)).arg(value);
1156 case EFT_EMPIRE_SIZE_BASE:
1157 case EFT_EMPIRE_SIZE_STEP:
1158 return QString(
PL_(
"%1 city",
"%1 cities", value)).arg(value);
1159 case EFT_REVOLUTION_UNHAPPINESS:
1160 return QString(
PL_(
"%1 turn",
"%1 turns", value)).arg(value);
1161 case EFT_TRADE_REVENUE_BONUS: {
1163 int factor = 100 * std::pow(2.0, value / 1000.);
1164 return QString(
PL_(
"%1%",
"%1%", factor)).arg(factor);
1166 case EFT_TRADE_REVENUE_EXPONENT: {
1168 float factor = 1.0f + value / 1000.0f;
1169 return QString(
PL_(
"**%1",
"**%1", factor)).arg(factor);
1171 case EFT_OUTPUT_WASTE_BY_DISTANCE: {
1172 float waste = value / 100.0f;
1173 return QString(
PL_(
"%1%/tile",
"%1%/tile", waste)).arg(waste);
1175 case EFT_CITY_BUILD_SLOTS:
1176 return QString(
PL_(
"%1 slot",
"%1 slots", value)).arg(value);
1177 case EFT_MAX_TRADE_ROUTES:
1179 return QString(
PL_(
"%1 route",
"%1 routes", value)).arg(value);
1180 case EFT_COMBAT_ROUNDS:
1182 return QString(
PL_(
"%1 round",
"%1 rounds", value)).arg(value);
1183 case EFT_PERFORMANCE:
1185 case EFT_NATION_PERFORMANCE:
1186 case EFT_NATION_HISTORY:
1187 return QString(
PL_(
"%1 culture point",
"%1 culture points", value))
1189 case EFT_TURN_FRAGMENTS:
1190 return QString(
PL_(
"%1 fragment",
"%1 fragments", value)).arg(value);
1191 case EFT_UNIT_SLOTS:
1193 return QString(
PL_(
"%1 slot",
"%1 slots", value)).arg(value);
1194 case EFT_INFRA_POINTS:
1195 return QString(
PL_(
"%1 infrastructure point",
"%1 infrastructure points",
1198 case EFT_ANY_GOVERNMENT:
1199 case EFT_CAPITAL_CITY:
1200 case EFT_ENABLE_NUKE:
1201 case EFT_ENABLE_SPACE:
1202 case EFT_SPECIALIST_OUTPUT:
1204 case EFT_OUTPUT_ADD_TILE:
1205 case EFT_OUTPUT_INC_TILE:
1206 case EFT_HAVE_EMBASSIES:
1207 case EFT_MAKE_CONTENT_MIL_PER:
1208 case EFT_NO_ANARCHY:
1209 case EFT_NUKE_PROOF:
1210 case EFT_REVEAL_CITIES:
1211 case EFT_REVEAL_MAP:
1212 case EFT_SIZE_UNLIMIT:
1213 case EFT_SS_STRUCTURAL:
1214 case EFT_SS_COMPONENT:
1216 case EFT_UNIT_NO_LOSE_POP:
1217 case EFT_TECH_UPKEEP_FREE:
1218 case EFT_NO_UNHAPPY:
1219 case EFT_SLOW_DOWN_TIMELINE:
1220 case EFT_RAPTURE_GROW:
1221 case EFT_HAS_SENATE:
1222 case EFT_INSPIRE_PARTISANS:
1223 case EFT_HAPPINESS_TO_GOLD:
1225 case EFT_NO_DIPLOMACY:
1226 case EFT_UNHAPPY_FACTOR:
1227 case EFT_UPKEEP_FACTOR:
1228 case EFT_UNIT_UPKEEP_FREE_PER_CITY:
1229 case EFT_OUTPUT_PENALTY_TILE:
1230 case EFT_OUTPUT_INC_TILE_CELEBRATE:
1231 case EFT_VISIBLE_WALLS:
1232 case EFT_TECH_COST_FACTOR:
1233 case EFT_TILE_WORKABLE:
1234 case EFT_CITY_IMAGE:
1235 case EFT_GOV_CENTER:
1236 case EFT_NOT_TECH_SOURCE:
1238 case EFT_HAVE_CONTACTS:
1239 case EFT_CASUS_BELLI_CAUGHT:
1240 case EFT_CASUS_BELLI_SUCCESS:
1241 case EFT_BORDER_VISION:
1242 case EFT_STEALINGS_IGNORE:
1243 case EFT_CASUS_BELLI_COMPLETE:
1244 case EFT_WONDER_VISIBLE:
1245 case EFT_NATION_INTELLIGENCE:
1247 return QStringLiteral(
"%1").arg(value);
1265 if (!cb(peffect, data)) {
QString strvec_to_and_list(const QVector< QString > &psv)
struct player * city_owner(const struct city *pcity)
Return the owner of the city.
struct tile * city_tile(const struct city *pcity)
Return the tile location of the city.
void recv_ruleset_effect(const struct packet_ruleset_effect *packet)
Receives a new effect.
int get_target_bonus_effects(struct effect_list *plist, const struct player *target_player, const struct player *other_player, const struct city *target_city, const struct impr_type *target_building, const struct tile *target_tile, const struct unit *target_unit, const struct unit_type *target_unittype, const struct output_type *target_output, const struct specialist *target_specialist, const struct action *target_action, enum effect_type effect_type, enum vision_layer vision_layer, enum national_intelligence nintel)
Returns the effect bonus of a given type for any target.
int get_potential_improvement_bonus(const struct impr_type *pimprove, const struct city *pcity, enum effect_type effect_type, const enum req_problem_type prob_type)
Returns the effect bonus the improvement would or does provide if present.
struct effect_list * effects[EFT_COUNT]
struct effect_list * govs[G_LAST]
struct effect_list * tracker
int get_tile_output_bonus(const struct city *pcity, const struct tile *ptile, const struct output_type *poutput, enum effect_type effect_type)
Returns the effect bonus at a tile for given output type (or nullptr for output-type-independent bonu...
int get_player_output_bonus(const struct player *pplayer, const struct output_type *poutput, enum effect_type effect_type)
Returns the player effect bonus of an output.
int get_city_specialist_output_bonus(const struct city *pcity, const struct specialist *pspecialist, const struct output_type *poutput, enum effect_type effect_type)
Returns the effect bonus of a specialist in a city.
bool is_building_replaced(const struct city *pcity, const struct impr_type *pimprove, const enum req_problem_type prob_type)
Returns TRUE if a building is replaced.
int get_player_bonus_effects(struct effect_list *plist, const struct player *pplayer, enum effect_type effect_type)
Returns the effect sources of this type currently active at the player.
int get_player_intel_bonus(const struct player *pplayer, const struct player *pother, enum national_intelligence nintel, enum effect_type effect_type)
Gets the player effect bonus of a national intelligence.
bool iterate_effect_cache(iec_cb cb, void *data)
Iterate through all the effects in cache, and call callback for each.
int get_current_construction_bonus(const struct city *pcity, enum effect_type effect_type, const enum req_problem_type prob_type)
Returns the effect bonus the currently-in-construction-item will provide.
int get_city_bonus_effects(struct effect_list *plist, const struct city *pcity, const struct output_type *poutput, enum effect_type effect_type)
Returns the effect sources of this type currently active at the city.
int get_unittype_bonus(const struct player *pplayer, const struct tile *ptile, const struct unit_type *punittype, enum effect_type effect_type, enum vision_layer vision_layer)
Returns the effect bonus that applies at a tile for a given unittype.
int get_unit_bonus(const struct unit *punit, enum effect_type effect_type)
Returns the effect bonus at a unit.
void ruleset_cache_init()
Initialize the ruleset cache.
int get_city_output_bonus(const struct city *pcity, const struct output_type *poutput, enum effect_type effect_type)
Returns the player effect bonus of an output.
void ruleset_cache_free()
Free the ruleset cache.
QString effect_type_unit_text(effect_type type, int value)
Returns a string describing an effect value as interpreted in the context of an effect_type,...
void send_ruleset_cache(struct conn_list *dest)
Send the ruleset cache data over the network.
void get_effect_req_text(const struct effect *peffect, char *buf, size_t buf_len)
Make user-friendly text for the source.
struct effect_list * get_req_source_effects(struct universal *psource)
Get a list of effects with this requirement source.
struct effect_list * buildings[B_LAST]
const effect_list * get_effects()
Get a list of all effects.
int get_building_bonus(const struct city *pcity, const struct impr_type *building, enum effect_type effect_type)
Returns the effect bonus at a building.
int effect_value_from_universals(enum effect_type type, struct universal *unis, size_t n_unis)
Return the base value of a given effect that can always be expected from just the sources in the list...
int get_city_tile_output_bonus(const struct city *pcity, const struct tile *ptile, const struct output_type *poutput, enum effect_type effect_type)
Returns the effect bonus at a city tile.
struct effect * effect_copy(struct effect *old)
Return new copy of the effect.
int effect_cumulative_max(enum effect_type type, struct universal *for_uni)
Get the maximum effect value in this ruleset for the universal (that is, the sum of all positive effe...
struct effect * effect_new(enum effect_type type, int value, struct multiplier *pmul)
Add effect to ruleset cache.
struct effect_list * advances[A_LAST]
int get_world_bonus(enum effect_type effect_type)
Returns the effect bonus for the whole world.
int effect_cumulative_min(enum effect_type type, struct universal *for_uni)
Get the minimum effect value in this ruleset for the universal (that is, the sum of all negative effe...
QString get_effect_list_req_text(const struct effect_list *plist)
Make user-friendly text for an effect list.
static struct @19 ruleset_cache
The code creates a ruleset cache on ruleset load.
bool building_has_effect(const struct impr_type *pimprove, enum effect_type effect_type)
Returns TRUE if the building has any effect bonuses of the given type.
int get_city_bonus(const struct city *pcity, enum effect_type effect_type, enum vision_layer vlayer)
Returns the effect bonus at a city.
static bool is_effect_prevented(const struct player *target_player, const struct player *other_player, const struct city *target_city, const struct impr_type *target_building, const struct tile *target_tile, const struct unit *target_unit, const struct unit_type *target_unittype, const struct output_type *target_output, const struct specialist *target_specialist, const struct effect *peffect, const enum req_problem_type prob_type)
Return TRUE iff any of the disabling requirements for this effect are active, which would prevent it ...
void effect_req_append(struct effect *peffect, struct requirement req)
Append requirement to effect.
int get_player_bonus(const struct player *pplayer, enum effect_type effect_type)
Returns the effect bonus for a player.
#define effect_list_iterate_end
bool(* iec_cb)(struct effect *, void *data)
#define effect_list_iterate(effect_list, peffect)
#define PL_(String1, String2, n)
Government_type_id government_count()
Return the number of governments.
Impr_type_id improvement_count()
Return the number of improvements.
struct impr_type * improvement_by_number(const Impr_type_id id)
Returns the improvement type for the given index/ID.
Impr_type_id improvement_number(const struct impr_type *pimprove)
Return the improvement index.
#define fc_assert(condition)
#define fc_assert_ret_val(condition, val)
struct multiplier * multiplier_by_number(Multiplier_type_id id)
Returns multiplier associated to given number.
const char * multiplier_name_translation(const struct multiplier *pmul)
Return the (translated) name of the multiplier.
Multiplier_type_id multiplier_number(const struct multiplier *pmul)
Returns multiplier number.
int player_multiplier_effect_value(const struct player *pplayer, const struct multiplier *pmul)
Return the multiplier value currently in effect for pplayer, scaled from display units to the units u...
void universal_extraction(const struct universal *source, int *kind, int *value)
Extract universal structure into its components for serialization; the opposite of universal_by_numbe...
bool universal_fulfills_requirements(bool check_necessary, const struct requirement_vector *reqs, const struct universal *source)
Will the universal 'source' fulfill the requirements in the list? If 'check_necessary' is FALSE: are ...
bool is_req_active(const struct player *target_player, const struct player *other_player, const struct city *target_city, const struct impr_type *target_building, const struct tile *target_tile, const struct unit *target_unit, const struct unit_type *target_unittype, const struct output_type *target_output, const struct specialist *target_specialist, const struct action *target_action, const struct requirement *req, const enum req_problem_type prob_type, const enum vision_layer vision_layer, const enum national_intelligence nintel)
Checks the requirement to see if it is active on the given target.
bool are_reqs_active(const struct player *target_player, const struct player *other_player, const struct city *target_city, const struct impr_type *target_building, const struct tile *target_tile, const struct unit *target_unit, const struct unit_type *target_unittype, const struct output_type *target_output, const struct specialist *target_specialist, const struct action *target_action, const struct requirement_vector *reqs, const enum req_problem_type prob_type, const enum vision_layer vision_layer, const enum national_intelligence nintel)
Checks the requirement(s) to see if they are active on the given target.
const char * universal_name_translation(const struct universal *psource, char *buf, size_t bufsz)
Make user-friendly text for the source.
enum req_item_found universal_fulfills_requirement(const struct requirement *preq, const struct universal *source)
Will the universal 'source' fulfill this requirement?
#define requirement_vector_iterate_end
#define requirement_vector_iterate(req_vec, preq)
struct universal production
struct multiplier * multiplier
struct requirement_vector reqs
size_t fc_strlcat(char *dest, const char *src, size_t n)
fc_strlcat() provides utf-8 version of (non-standard) function strlcat() It is intended as more user-...
Tech_type_id advance_count()
Return the number of advances/technologies.
struct city * tile_city(const struct tile *ptile)
Return the city on this tile (or nullptr), checking for city center.
const struct impr_type * building
const struct unit_type * unit_type_get(const struct unit *punit)
Return the unit type for this unit.