Freeciv-3.3
|
#include <string.h>
#include "bugs.h"
#include "fcintl.h"
#include "log.h"
#include "mem.h"
#include "shared.h"
#include "specialist.h"
#include "support.h"
#include "timing.h"
#include "city.h"
#include "dataio.h"
#include "events.h"
#include "game.h"
#include "government.h"
#include "nation.h"
#include "packets.h"
#include "attribute.h"
#include "client_main.h"
#include "climisc.h"
#include "packhand.h"
#include "chatline_g.h"
#include "citydlg_g.h"
#include "cityrep_g.h"
#include "messagewin_g.h"
#include "agents.h"
#include "cma_core.h"
Go to the source code of this file.
Variables | ||
struct { | ||
struct timer * wall_timer | ||
int apply_result_ignored | ||
int apply_result_applied | ||
int refresh_forced | ||
} | stats | |
Definition at line 80 of file cma_core.c.
#define CMA_ATTR_VERSION 3 |
Definition at line 85 of file cma_core.c.
#define CMA_ATTR_VERSION_MIN_SUPPORTED 2 |
Definition at line 86 of file cma_core.c.
Definition at line 73 of file cma_core.c.
Definition at line 74 of file cma_core.c.
Definition at line 75 of file cma_core.c.
Definition at line 76 of file cma_core.c.
#define SAVED_PARAMETER_SIZE 30 |
Definition at line 82 of file cma_core.c.
#define SAVED_PARAMETER_SIZE_OLD 29 |
Definition at line 83 of file cma_core.c.
Definition at line 79 of file cma_core.c.
Definition at line 78 of file cma_core.c.
Change the actual city setting to the given result. Returns TRUE iff the actual data matches the calculated one.
Definition at line 169 of file cma_core.c.
Referenced by cma_apply_result(), and handle_city().
Returns TRUE if the city is valid for CMA. Fills parameter if TRUE is returned. Parameter can be NULL.
Definition at line 142 of file cma_core.c.
Referenced by apply_result_on_server(), and handle_city().
Callback for the agent interface.
Definition at line 448 of file cma_core.c.
Referenced by cma_init(), and handle_trade_route_info().
Callback for the agent interface.
Definition at line 461 of file cma_core.c.
Referenced by cma_init().
Apply result on server if it's valid
Definition at line 510 of file cma_core.c.
Referenced by run_cma_once_callback().
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 575 of file cma_core.c.
Referenced by check_city(), cma_is_city_under_agent(), and cmafec_get_fe_parameter().
Initialize city governor code
Definition at line 478 of file cma_core.c.
Referenced by agents_init().
Check whether city is under governor control, and fill parameter if it is.
Definition at line 552 of file cma_core.c.
Referenced by adjust_workers_button_pressed(), append_cma_to_menu_item(), button_down_citymap(), button_press_callback(), canvas_draw_cb(), canvas_exposed_cb(), city_dlg_callback(), cma_activate_preset_callback(), cma_activate_preset_callback(), cma_active_callback(), cma_apply_result(), city_dialog::cma_double_clicked(), city_dialog::cma_enable(), city_dialog::cma_selected(), city_dialog::cma_slider(), city_dialog::cma_toggle_changed(), city_dialog::cma_toggle_changed_depr(), cmafec_get_fe_parameter(), cmafec_get_short_descr_of_city(), create_governor_menu(), enable_city_dlg_widgets(), factor_horiz_cma_callback(), hscale_changed(), ld_cma_callback(), left_button_down_citymap(), min_horiz_cma_callback(), city_label::mousePressEvent(), city_map::paintEvent(), popup_load_del_presets_dialog(), real_city_dialog_popup(), real_city_report_dialog_update_city(), real_info_city_report_dialog_update(), rebuild_citydlg_title_str(), redraw_city_dialog(), refresh_cma_dialog(), select_cma_callback(), select_governor_callback(), set_client_state(), update_city_cma_dialog(), city_dialog::update_cma_tab(), and city_dialog::update_sliders().
Put city under governor control
Definition at line 524 of file cma_core.c.
Referenced by button_press_callback(), button_press_callback(), cma_activate_preset_callback(), cma_activate_preset_callback(), cma_active_callback(), city_dialog::cma_changed(), city_dialog::cma_double_clicked(), cma_iterate(), city_dialog::cma_selected(), city_widget::display_list_menu(), factor_horiz_cma_callback(), governors_iterate(), hscale_changed(), min_horiz_cma_callback(), and run_cma_callback().
Release city from governor control.
Definition at line 542 of file cma_core.c.
Referenced by button_press_callback(), check_city(), cma_activate_preset_callback(), cma_activate_preset_callback(), cma_active_callback(), city_dialog::cma_double_clicked(), city_dialog::cma_enable(), cma_iterate(), city_dialog::cma_selected(), city_widget::display_list_menu(), factor_horiz_cma_callback(), governors_iterate(), handle_city(), hscale_changed(), ld_cma_callback(), min_horiz_cma_callback(), popup_cma_from_city_report_callback(), popup_load_del_presets_dialog(), set_client_state(), and stop_cma_callback().
Set attribute block for city from parameter.
Definition at line 624 of file cma_core.c.
Referenced by cma_put_city_under_agent(), and cmafec_set_fe_parameter().
|
static |
Returns TRUE iff the two results are equal. Both results have to be results for the given city.
Definition at line 100 of file cma_core.c.
Referenced by apply_result_on_server().
The given city has changed. handle_city ensures that either the city follows the set CMA goal or that the CMA detaches itself from the city.
Definition at line 372 of file cma_core.c.
Referenced by city_changed().
Callback for the agent interface.
Definition at line 469 of file cma_core.c.
Referenced by cma_init().
Remove governor setting from city.
Definition at line 358 of file cma_core.c.
Referenced by city_remove(), and cma_release_city().
Prints the data of the stats struct via log_test(...).
Definition at line 339 of file cma_core.c.
Referenced by new_turn().
int apply_result_applied |
Definition at line 93 of file cma_core.c.
int apply_result_ignored |
Definition at line 93 of file cma_core.c.
int refresh_forced |
Definition at line 93 of file cma_core.c.
struct { ... } stats |
Referenced by apply_result_on_server(), cma_init(), and report_stats().
Definition at line 92 of file cma_core.c.