34 int *num_entries_used,
int *total_cost,
37 *num_entries_used = 0;
49 QStringList redundant_cities;
50 int count = 0, cost = 0;
57 redundant_cities.append(pcity->name);
67 if (redundant_cities.isEmpty()) {
71 str = redundant_cities.join(
", ");
74 entries[*num_entries_used].
type = pimprove;
75 entries[*num_entries_used].
count = count;
76 entries[*num_entries_used].
redundant = redundant_cities.size();
78 entries[*num_entries_used].
cost = cost / count;
80 (*num_entries_used)++;
95 *total_income += pcity->prod[
O_GOLD];
108 int *num_entries_used,
int *total_cost)
110 int count, cost, partial_cost;
112 *num_entries_used = 0;
137 partial_cost += punit->upkeep[
O_GOLD];
148 (*total_cost) += partial_cost;
150 entries[*num_entries_used].
type = unittype;
151 entries[*num_entries_used].
count = count;
152 entries[*num_entries_used].
cost = cost;
153 entries[*num_entries_used].
total_cost = partial_cost;
154 (*num_entries_used)++;
168 bool redundant_only,
char *
message,
171 int count = 0, gold = 0;
195 PL_(
"Sold %d %s for %d gold.",
"Sold %d %s for %d gold.", gold),
211 bool in_cities_only,
char *
message,
size_t message_sz)
bool city_has_building(const struct city *pcity, const struct impr_type *pimprove)
Return TRUE iff the city has this building in it.
struct player * city_owner(const struct city *pcity)
Return the owner of the city.
int city_improvement_upkeep(const struct city *pcity, const struct impr_type *b)
Return the upkeep (gold) needed each turn to upkeep the given improvement in the given city.
bool city_production_has_flag(const struct city *pcity, enum impr_flag_id flag)
Return TRUE when the current production has this flag.
#define city_list_iterate(citylist, pcity)
#define city_list_iterate_end
int city_sell_improvement(struct city *pcity, Impr_type_id sell_id)
Change the production of a given city.
bool can_client_issue_orders()
Returns TRUE iff the client can issue orders (such as giving unit commands).
void request_unit_disband(struct unit *punit)
Send request to disband unit to server.
#define PL_(String1, String2, n)
struct government * government_of_player(const struct player *pplayer)
Return the government of a player.
int impr_sell_gold(const struct impr_type *pimprove)
Returns the amount of gold received when this improvement is sold.
bool is_improvement_redundant(const struct city *pcity, const struct impr_type *pimprove)
Returns TRUE if an improvement in a city is redundant, that is, the city wouldn't lose anything by lo...
bool is_improvement(const struct impr_type *pimprove)
Is this building a regular improvement?
Impr_type_id improvement_number(const struct impr_type *pimprove)
Return the improvement index.
const char * improvement_name_translation(const struct impr_type *pimprove)
Return the (translated) name of the given improvement.
#define improvement_iterate_end
#define improvement_iterate(_p)
void get_economy_report_units_data(struct unit_entry *entries, int *num_entries_used, int *total_cost)
Returns an array of units with gold_upkeep.
void get_economy_report_data(struct improvement_entry *entries, int *num_entries_used, int *total_cost, int *total_income)
Fills out the array of struct improvement_entry given by entries.
void sell_all_improvements(const struct impr_type *pimprove, bool redundant_only, char *message, size_t message_sz)
Sell all improvements of the given type in all cities.
void disband_all_units(const struct unit_type *punittype, bool in_cities_only, char *message, size_t message_sz)
Disband all supported units of the given type.
struct government * government_during_revolution
struct city_list * cities
int fc_snprintf(char *str, size_t n, const char *format,...)
See also fc_utf8_snprintf_trunc(), fc_utf8_snprintf_rep().
struct city * tile_city(const struct tile *ptile)
Return the city on this tile (or nullptr), checking for city center.
#define unit_list_iterate(unitlist, punit)
#define unit_list_iterate_end
const struct unit_type * unit_type_get(const struct unit *punit)
Return the unit type for this unit.
int utype_upkeep_cost(const struct unit_type *ut, struct player *pplayer, Output_type_id otype)
Returns the upkeep of a unit of this type under the given government.
const char * utype_name_translation(const struct unit_type *punittype)
Return the (translated) name of the unit type.
bool utype_can_do_action(const struct unit_type *putype, const action_id act_id)
Return TRUE iff units of the given type can do the specified generalized (ruleset defined) action ena...
#define unit_type_iterate(_p)
#define unit_type_iterate_end