Freeciv21
Develop your civilization from humble roots to a global empire
citydlg_common.h
Go to the documentation of this file.
1 /*__ ___ ***************************************
2 / \ / \ Copyright (c) 1996-2020 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 // common
17 #include "city.h"
18 #include "fc_types.h"
19 
20 #include <QString>
21 
22 struct worklist;
23 
27 
28 char *city_production_cost_str(const struct city *pcity);
29 void get_city_dialog_production(struct city *pcity, char *buffer,
30  size_t buffer_len);
31 
32 QString get_city_dialog_output_text(const struct city *pcity,
33  Output_type_id otype);
34 QString get_city_dialog_pollution_text(const struct city *pcity);
35 QString get_city_dialog_culture_text(const struct city *pcity);
36 QString get_city_dialog_illness_text(const struct city *pcity);
37 QString get_city_dialog_airlift_text(const struct city *pcity);
38 QString get_city_dialog_size_text(const struct city *pcity);
39 QString get_city_dialog_status_text(const struct city *pcity);
40 
41 QString get_city_dialog_growth_value(const struct city *pcity);
42 QString get_city_dialog_airlift_value(const struct city *pcity);
43 
44 int get_city_citizen_types(struct city *pcity, enum citizen_feeling index,
45  enum citizen_category *categories);
46 void city_rotate_specialist(struct city *pcity, int citizen_index);
47 
48 int city_change_production(struct city *pcity, struct universal *target);
49 int city_set_worklist(struct city *pcity, const struct worklist *pworklist);
50 
51 bool city_queue_insert(struct city *pcity, int position,
52  struct universal *target);
53 bool city_queue_insert_worklist(struct city *pcity, int position,
54  const struct worklist *worklist);
55 void city_get_queue(struct city *pcity, struct worklist *pqueue);
56 bool city_set_queue(struct city *pcity, const struct worklist *pqueue);
57 bool city_can_buy(const struct city *pcity);
58 int city_sell_improvement(struct city *pcity, Impr_type_id sell_id);
59 int city_buy_production(struct city *pcity);
60 int city_change_specialist(struct city *pcity, Specialist_type_id from,
62 int city_rename(struct city *pcity, const char *name);
citizen_category
Definition: city.h:239
citizen_feeling
Definition: city.h:250
QString get_city_dialog_airlift_value(const struct city *pcity)
Return airlift capacity.
bool city_queue_insert(struct city *pcity, int position, struct universal *target)
Insert an item into the city's queue.
int get_city_citizen_types(struct city *pcity, enum citizen_feeling index, enum citizen_category *categories)
Provide a list of all citizens in the city, in order.
QString get_city_dialog_status_text(const struct city *pcity)
Return text describing the city's status: disorder/celebrating/...
int get_citydlg_canvas_height()
Return the height of the city dialog canvas.
QString get_city_dialog_culture_text(const struct city *pcity)
Return text describing the culture output.
QString get_city_dialog_output_text(const struct city *pcity, Output_type_id otype)
Return text describing the production output.
void get_city_dialog_production(struct city *pcity, char *buffer, size_t buffer_len)
Find the city dialog city production text for the given city, and place it into the buffer.
int city_set_worklist(struct city *pcity, const struct worklist *pworklist)
Set the worklist for a given city.
int city_rename(struct city *pcity, const char *name)
Tell the server to rename the city.
char * city_production_cost_str(const struct city *pcity)
Return a string describing the cost for the production of the city considerung several build slots fo...
int city_buy_production(struct city *pcity)
Buy the current production item in a given city.
bool city_queue_insert_worklist(struct city *pcity, int position, const struct worklist *worklist)
Insert the worklist into the city's queue at the given position.
QString get_city_dialog_growth_value(const struct city *pcity)
Return time until next growth.
bool city_set_queue(struct city *pcity, const struct worklist *pqueue)
Set the city current production and the worklist, like it should be.
QString get_city_dialog_size_text(const struct city *pcity)
Return text describing the city's citizens.
QString get_city_dialog_pollution_text(const struct city *pcity)
Return text describing the pollution output.
int city_change_production(struct city *pcity, struct universal *target)
Change the production of a given city.
void city_rotate_specialist(struct city *pcity, int citizen_index)
Rotate the given specialist citizen to the next type of citizen.
QString get_city_dialog_airlift_text(const struct city *pcity)
Return text describing airlift capacity.
int get_citydlg_canvas_width()
Return the width of the city dialog canvas.
void city_get_queue(struct city *pcity, struct worklist *pqueue)
Get the city current production and the worklist, like it should be.
int city_sell_improvement(struct city *pcity, Impr_type_id sell_id)
Change the production of a given city.
void generate_citydlg_dimensions()
Calculate the citydlg width and height.
int city_change_specialist(struct city *pcity, Specialist_type_id from, Specialist_type_id to)
Change a specialist in the given city.
QString get_city_dialog_illness_text(const struct city *pcity)
Return text describing the chance for a plague.
bool city_can_buy(const struct city *pcity)
Return TRUE iff the city can buy.
int Impr_type_id
Definition: fc_types.h:293
int Specialist_type_id
Definition: fc_types.h:292
enum output_type_id Output_type_id
Definition: fc_types.h:295
const char * name
Definition: inputfile.cpp:118
Definition: city.h:291