![]() |
Freeciv21
Develop your civilization from humble roots to a global empire
|
#include <QElapsedTimer>#include "bugs.h"#include "fciconv.h"#include "city.h"#include "dataio.h"#include "featured_text.h"#include "nation.h"#include "player.h"#include "specialist.h"#include "attribute.h"#include "citydlg_common.h"#include "client_main.h"#include "climisc.h"#include "citydlg_g.h"#include "cityrep_g.h"#include "mapctrl_g.h"#include "governor.h"#include "speclist.h"
Include dependency graph for governor.cpp:Go to the source code of this file.
Classes | |
| struct | cma_preset |
| class | cma_yoloswag |
Macros | |
| #define | log_apply_result log_debug |
| #define | log_handle_city log_debug |
| #define | log_handle_city2 log_debug |
| #define | log_results_are_equal log_debug |
| #define | SHOW_APPLY_RESULT_ON_SERVER_ERRORS false |
| #define | ALWAYS_APPLY_AT_SERVER false |
| #define | MAX_LEN_PRESET_NAME 80 |
| #define | SAVED_PARAMETER_SIZE 32 |
| #define | CMA_NUM_PARAMS 5 |
| #define | SPECLIST_TAG preset |
| #define | SPECLIST_TYPE struct cma_preset |
Functions | |
| bool | operator== (const struct cm_result &result1, const struct cm_result &result2) |
| int | cities_results_request () |
| void | cma_got_result (int citynr) |
| void | cma_put_city_under_agent (struct city *pcity, const struct cm_parameter *const parameter) |
| Put city under governor control. More... | |
| void | cma_release_city (struct city *pcity) |
| Release city from governor control. More... | |
| bool | cma_is_city_under_agent (const struct city *pcity, struct cm_parameter *parameter) |
| Check whether city is under governor control, and fill parameter if it is. More... | |
| bool | cma_get_parameter (enum attr_city attr, int city_id, struct cm_parameter *parameter) |
| Get the parameter. More... | |
| void | cma_set_parameter (enum attr_city attr, int city_id, const struct cm_parameter *parameter) |
| Set attribute block for city from parameter. More... | |
| void | cmafec_set_fe_parameter (struct city *pcity, const struct cm_parameter *const parameter) |
| Sets the front-end parameter. More... | |
| void | cmafec_get_fe_parameter (struct city *pcity, struct cm_parameter *dest) |
| Return the front-end parameter for the given city. More... | |
| void | cmafec_preset_add (const char *descr_name, const cm_parameter *pparam) |
| Adds a preset. More... | |
| void | cmafec_preset_remove (int idx) |
| Removes a preset. More... | |
| char * | cmafec_preset_get_descr (int idx) |
| Returns the indexed preset's description. More... | |
| const struct cm_parameter * | cmafec_preset_get_parameter (int idx) |
| Returns the indexed preset's parameter. More... | |
| int | cmafec_preset_get_index_of_parameter (const struct cm_parameter *const parameter) |
| Returns the index of the preset which matches the given parameter. More... | |
| int | cmafec_preset_num () |
| Returns the total number of presets. More... | |
| const char * | cmafec_get_short_descr_of_city (const struct city *pcity) |
| Return short description of city governor preset. More... | |
| const char * | cmafec_get_short_descr (const struct cm_parameter *const parameter) |
| Returns the description of the matching preset or "custom" if no preset could be found. More... | |
| void | create_default_cma_presets () |
| Create default cma presets for a new user (or without configuration file) More... | |
Variables | |
| static struct preset_list * | preset_list = nullptr |
| struct { | |
| int apply_result_ignored | |
| int apply_result_applied | |
| int refresh_forced | |
| } | stats |
| #define ALWAYS_APPLY_AT_SERVER false |
Definition at line 44 of file governor.cpp.
| #define CMA_NUM_PARAMS 5 |
Definition at line 48 of file governor.cpp.
| #define log_apply_result log_debug |
Definition at line 38 of file governor.cpp.
| #define log_handle_city log_debug |
Definition at line 39 of file governor.cpp.
| #define log_handle_city2 log_debug |
Definition at line 40 of file governor.cpp.
| #define log_results_are_equal log_debug |
Definition at line 41 of file governor.cpp.
| #define MAX_LEN_PRESET_NAME 80 |
Definition at line 45 of file governor.cpp.
| #define SAVED_PARAMETER_SIZE 32 |
Definition at line 46 of file governor.cpp.
| #define SHOW_APPLY_RESULT_ON_SERVER_ERRORS false |
Definition at line 43 of file governor.cpp.
| #define SPECLIST_TAG preset |
Definition at line 50 of file governor.cpp.
| #define SPECLIST_TYPE struct cma_preset |
Definition at line 51 of file governor.cpp.
| int cities_results_request | ( | ) |
Definition at line 204 of file governor.cpp.
Referenced by input_from_server().
| bool cma_get_parameter | ( | enum attr_city | attr, |
| int | city_id, | ||
| struct cm_parameter * | parameter | ||
| ) |
Get the parameter.
Don't bother to cm_init_parameter, since we set all the fields anyway. But leave the comment here so we can find this place when searching for all the creators of a parameter.
Definition at line 645 of file governor.cpp.
Referenced by cma_yoloswag::check_city(), cmafec_get_fe_parameter(), and cma_yoloswag::is_city_under_agent().
| void cma_got_result | ( | int | citynr | ) |
Definition at line 206 of file governor.cpp.
Referenced by input_from_server().
| bool cma_is_city_under_agent | ( | const struct city * | pcity, |
| struct cm_parameter * | parameter | ||
| ) |
Check whether city is under governor control, and fill parameter if it is.
Definition at line 632 of file governor.cpp.
Referenced by adjust_workers_button_pressed(), client_state(), city_dialog::cma_check_agent(), city_dialog::cma_double_clicked(), city_dialog::cma_enable(), city_dialog::cma_selected(), cmafec_get_fe_parameter(), cmafec_get_short_descr_of_city(), do_map_click(), city_label::mousePressEvent(), city_dialog::update_cma_tab(), and city_dialog::update_sliders().
| void cma_put_city_under_agent | ( | struct city * | pcity, |
| const struct cm_parameter *const | parameter | ||
| ) |
Put city under governor control.
Definition at line 618 of file governor.cpp.
Referenced by city_dialog::cma_changed(), city_dialog::cma_double_clicked(), city_dialog::cma_selected(), and city_widget::display_list_menu().
| void cma_release_city | ( | struct city * | pcity | ) |
Release city from governor control.
Definition at line 627 of file governor.cpp.
Referenced by cma_yoloswag::check_city(), client_state(), city_dialog::cma_enable(), city_widget::display_list_menu(), and cma_yoloswag::handle_city().
| void cma_set_parameter | ( | enum attr_city | attr, |
| int | city_id, | ||
| const struct cm_parameter * | parameter | ||
| ) |
Set attribute block for city from parameter.
Definition at line 654 of file governor.cpp.
Referenced by cmafec_set_fe_parameter(), and cma_yoloswag::put_city_under_agent().
| void cmafec_get_fe_parameter | ( | struct city * | pcity, |
| struct cm_parameter * | dest | ||
| ) |
Return the front-end parameter for the given city.
Returns a dummy parameter if no parameter was set.
Definition at line 673 of file governor.cpp.
Referenced by city_dialog::update_cma_tab().
| const char* cmafec_get_short_descr | ( | const struct cm_parameter *const | parameter | ) |
Returns the description of the matching preset or "custom" if no preset could be found.
Definition at line 790 of file governor.cpp.
Referenced by cmafec_get_short_descr_of_city().
| const char* cmafec_get_short_descr_of_city | ( | const struct city * | pcity | ) |
Return short description of city governor preset.
Definition at line 774 of file governor.cpp.
Referenced by city_dialog::update_cma_tab().
| void cmafec_preset_add | ( | const char * | descr_name, |
| const cm_parameter * | pparam | ||
| ) |
Adds a preset.
Definition at line 692 of file governor.cpp.
Referenced by create_default_cma_presets(), and load_cma_preset().
| char* cmafec_preset_get_descr | ( | int | idx | ) |
Returns the indexed preset's description.
Definition at line 725 of file governor.cpp.
Referenced by city_dialog::cma_remove(), cmafec_get_short_descr(), city_widget::gen_cma_labels(), save_cma_preset(), and city_dialog::update_cma_tab().
| int cmafec_preset_get_index_of_parameter | ( | const struct cm_parameter *const | parameter | ) |
Returns the index of the preset which matches the given parameter.
Returns -1 if no preset could be found.
Definition at line 752 of file governor.cpp.
Referenced by cmafec_get_short_descr(), and city_dialog::update_cma_tab().
| const struct cm_parameter* cmafec_preset_get_parameter | ( | int | idx | ) |
Returns the indexed preset's parameter.
Definition at line 738 of file governor.cpp.
Referenced by city_dialog::cma_double_clicked(), city_dialog::cma_selected(), city_widget::display_list_menu(), save_cma_preset(), and city_dialog::update_sliders().
| int cmafec_preset_num | ( | ) |
Returns the total number of presets.
Definition at line 769 of file governor.cpp.
Referenced by city_dialog::cma_remove(), city_dialog::cma_selected(), cmafec_preset_get_descr(), cmafec_preset_get_parameter(), cmafec_preset_remove(), city_widget::gen_cma_labels(), save_cma_presets(), city_dialog::update_cma_tab(), and city_dialog::update_sliders().
| void cmafec_preset_remove | ( | int | idx | ) |
Removes a preset.
Definition at line 709 of file governor.cpp.
Referenced by city_dialog::cma_remove().
| void cmafec_set_fe_parameter | ( | struct city * | pcity, |
| const struct cm_parameter *const | parameter | ||
| ) |
Sets the front-end parameter.
Definition at line 663 of file governor.cpp.
Referenced by cmafec_get_fe_parameter().
| void create_default_cma_presets | ( | ) |
Create default cma presets for a new user (or without configuration file)
Definition at line 804 of file governor.cpp.
Definition at line 161 of file governor.cpp.
| int apply_result_applied |
Definition at line 62 of file governor.cpp.
| int apply_result_ignored |
Definition at line 62 of file governor.cpp.
|
static |
Definition at line 54 of file governor.cpp.
Referenced by cmafec_preset_add(), cmafec_preset_get_descr(), cmafec_preset_get_index_of_parameter(), cmafec_preset_get_parameter(), cmafec_preset_num(), and cmafec_preset_remove().
| int refresh_forced |
Definition at line 62 of file governor.cpp.
| struct { ... } stats |
Referenced by cma_yoloswag::apply_result_on_server(), and script_server_load_file().