Freeciv21
Develop your civilization from humble roots to a global empire
repodlgs_common.h
Go to the documentation of this file.
1 /*__ ___ ***************************************
2 / \ / \ Copyright (c) 1996-2023 Freeciv21 and Freeciv
3 \_ \ / __/ contributors. This file is part of Freeciv21.
4  _\ \ / /__ Freeciv21 is free software: you can redistribute it
5  \___ \____/ __/ and/or modify it under the terms of the GNU General
6  \_ _/ Public License as published by the Free Software
7  | @ @ \_ Foundation, either version 3 of the License,
8  | or (at your option) any later version.
9  _/ /\ You should have received a copy of the GNU
10  /o) (o/\ \_ General Public License along with Freeciv21.
11  \_____/ / If not, see https://www.gnu.org/licenses/.
12  \____/ ********************************************************/
13 
14 #pragma once
15 
16 #include <QString>
17 
18 /*
19  * Structure of data for the Economics View. See get_economy_report_data()
20  */
22  struct impr_type *type;
24  QString city_names;
25 };
26 
27 /*
28  * Structure of data for the Economics View. See
29  * get_economy_report_units_data()
30  */
31 struct unit_entry {
32  struct unit_type *type;
34 };
35 
36 void get_economy_report_data(struct improvement_entry *entries,
37  int *num_entries_used, int *total_cost,
38  int *total_income);
39 /* This function returns an array with the gold upkeeped units.
40  * FIXME: Many clients doesn't yet use this function and show also only the
41  * buildings in the economy reports
42  * I think that there should be only one function which returns an array of
43  * char* arrays like some other common functions but that means updating all
44  * client simultaneously and I simply can't */
45 void get_economy_report_units_data(struct unit_entry *entries,
46  int *num_entries_used, int *total_cost);
47 
48 void sell_all_improvements(const struct impr_type *pimprove,
49  bool redundant_only, char *message,
50  size_t message_sz);
51 void disband_all_units(const struct unit_type *punittype,
52  bool in_cities_only, char *message,
53  size_t message_sz);
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.
int cost
QString city_names
struct impr_type * type
int total_cost
int count
int redundant
int total_cost
struct unit_type * type
int count
int cost