Freeciv-3.1
|
Go to the source code of this file.
Data Structures | |
struct | cm_parameter |
struct | cm_result |
Functions | |
void | cm_init (void) |
void | cm_init_citymap (void) |
void | cm_clear_cache (struct city *pcity) |
void | cm_free (void) |
struct cm_result * | cm_result_new (struct city *pcity) |
void | cm_result_destroy (struct cm_result *result) |
void | cm_query_result (struct city *pcity, const struct cm_parameter *const parameter, struct cm_result *result, bool negative_ok) |
bool | cm_are_parameter_equal (const struct cm_parameter *const p1, const struct cm_parameter *const p2) |
void | cm_copy_parameter (struct cm_parameter *dest, const struct cm_parameter *const src) |
void | cm_init_parameter (struct cm_parameter *dest) |
void | cm_init_emergency_parameter (struct cm_parameter *dest) |
void | cm_print_city (const struct city *pcity) |
void | cm_print_result (const struct cm_result *result) |
int | cm_result_citizens (const struct cm_result *result) |
int | cm_result_specialists (const struct cm_result *result) |
int | cm_result_workers (const struct cm_result *result) |
void | cm_result_from_main_map (struct cm_result *result, const struct city *pcity) |
bool cm_are_parameter_equal | ( | const struct cm_parameter *const | p1, |
const struct cm_parameter *const | p2 | ||
) |
Returns true if the two cm_parameters are equal.
Definition at line 2139 of file cm.c.
Referenced by append_cma_to_menu_item(), cmafec_preset_get_index_of_parameter(), create_governor_menu(), select_cma_callback(), and select_governor_callback().
void cm_clear_cache | ( | struct city * | pcity | ) |
Clear the cache for a city.
Definition at line 320 of file cm.c.
Referenced by apply_result_on_server(), auto_arrange_workers(), city_changed(), and dai_manage_taxes().
void cm_copy_parameter | ( | struct cm_parameter * | dest, |
const struct cm_parameter *const | src | ||
) |
Copy the parameter from the source to the destination field.
Definition at line 2172 of file cm.c.
Referenced by begin_search(), cmafec_get_fe_parameter(), cmafec_preset_add(), ld_cma_callback(), popup_load_del_presets_dialog(), and city_dialog::update_sliders().
void cm_free | ( | void | ) |
Called at the end of a game to free any CM data.
Definition at line 328 of file cm.c.
Referenced by game_free().
void cm_init | ( | void | ) |
Initialize the CM data at the start of each game. Note the citymap indices will not have been initialized yet (cm_init_citymap is called when they are).
Definition at line 293 of file cm.c.
Referenced by game_init().
void cm_init_citymap | ( | void | ) |
Initialize the CM citymap data. This function is called when the city map indices are generated (basically when the topology is set, shortly after the start of the game).
Definition at line 312 of file cm.c.
Referenced by generate_city_map_indices().
void cm_init_emergency_parameter | ( | struct cm_parameter * | dest | ) |
Initialize the parameter to sane default values that will always produce a result.
Definition at line 2199 of file cm.c.
Referenced by auto_arrange_workers().
void cm_init_parameter | ( | struct cm_parameter * | dest | ) |
Initialize the parameter to sane default values.
Definition at line 2181 of file cm.c.
Referenced by auto_arrange_workers(), cma_get_parameter(), cmafec_get_fe_parameter(), and dai_manage_taxes().
void cm_print_city | ( | const struct city * | pcity | ) |
Debugging routines. Print debugging information about one city.
Definition at line 2429 of file cm.c.
Referenced by apply_result_on_server(), and auto_arrange_workers().
void cm_print_result | ( | const struct cm_result * | result | ) |
Print debugging information about a full CM result.
Definition at line 2467 of file cm.c.
Referenced by apply_result_on_server(), and auto_arrange_workers().
void cm_query_result | ( | struct city * | pcity, |
const struct cm_parameter * | param, | ||
struct cm_result * | result, | ||
bool | negative_ok | ||
) |
Wrapper that actually runs the branch & bound, and returns the best solution.
Definition at line 2120 of file cm.c.
Referenced by auto_arrange_workers(), dai_manage_taxes(), handle_city(), and run_cma_once_callback().
int cm_result_citizens | ( | const struct cm_result * | result | ) |
Count the total number of citizens in the result.
Definition at line 2250 of file cm.c.
Referenced by apply_result_on_server().
void cm_result_destroy | ( | struct cm_result * | result | ) |
Destroy a cm_result.
Definition at line 366 of file cm.c.
Referenced by apply_result_on_server(), auto_arrange_workers(), dai_manage_taxes(), handle_city(), refresh_cma_dialog(), run_cma_once_callback(), and update_city_cma_dialog().
Copy the city's current setup into the cm result structure. Wrapper for cm_result_main().
Definition at line 2259 of file cm.c.
Referenced by apply_result_on_server(), refresh_cma_dialog(), and update_city_cma_dialog().
Create a new cm_result.
Definition at line 343 of file cm.c.
Referenced by apply_result_on_server(), auto_arrange_workers(), dai_manage_taxes(), handle_city(), refresh_cma_dialog(), run_cma_once_callback(), and update_city_cma_dialog().
int cm_result_specialists | ( | const struct cm_result * | result | ) |
Count the total number of specialists in the result.
Definition at line 2236 of file cm.c.
Referenced by cm_result_citizens(), and cmafec_get_result_descr().
int cm_result_workers | ( | const struct cm_result * | result | ) |
Count the total number of workers in the result.
Definition at line 2216 of file cm.c.
Referenced by cm_print_result(), and cm_result_citizens().