Freeciv-3.3
Loading...
Searching...
No Matches
Functions
cma_fec.h File Reference
#include "cma_core.h"

Go to the source code of this file.

Functions

void cmafec_init (void)
 
void cmafec_free (void)
 
void cmafec_set_fe_parameter (struct city *pcity, const struct cm_parameter *const parameter)
 
void cmafec_get_fe_parameter (struct city *pcity, struct cm_parameter *dest)
 
const charcmafec_get_short_descr (const struct cm_parameter *const parameter)
 
const charcmafec_get_short_descr_of_city (const struct city *pcity)
 
const charcmafec_get_result_descr (struct city *pcity, const struct cm_result *result, const struct cm_parameter *const parameter)
 
void cmafec_preset_add (const char *descr_name, struct cm_parameter *pparam)
 
void cmafec_preset_remove (int idx)
 
int cmafec_preset_get_index_of_parameter (const struct cm_parameter *const parameter)
 
charcmafec_preset_get_descr (int idx)
 
const struct cm_parametercmafec_preset_get_parameter (int idx)
 
int cmafec_preset_num (void)
 
void create_default_cma_presets (void)
 

Function Documentation

◆ cmafec_free()

void cmafec_free ( void  )

Free resources allocated for presets system.

Definition at line 94 of file cma_fec.c.

◆ cmafec_get_fe_parameter()

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 115 of file cma_fec.c.

Referenced by button_press_callback(), button_press_callback(), cell_data_func(), cma_active_callback(), cma_preset_add_popup_callback(), create_cma_dialog(), hscale_changed(), popup_city_cma_dialog(), refresh_cma_dialog(), and city_dialog::update_cma_tab().

◆ cmafec_get_result_descr()

const char * cmafec_get_result_descr ( struct city pcity,
const struct cm_result result,
const struct cm_parameter *const  parameter 
)

Return string describing result

Definition at line 322 of file cma_fec.c.

Referenced by refresh_cma_dialog(), and update_city_cma_dialog().

◆ cmafec_get_short_descr()

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 236 of file cma_fec.c.

Referenced by cell_data_func(), cmafec_get_result_descr(), and cmafec_get_short_descr_of_city().

◆ 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 221 of file cma_fec.c.

Referenced by cr_entry_cma(), city_map::paintEvent(), and city_dialog::update_cma_tab().

◆ cmafec_init()

void cmafec_init ( void  )

Initialize the presets if there are no presets loaded on startup.

Definition at line 76 of file cma_fec.c.

Referenced by agents_init().

◆ cmafec_preset_add()

void cmafec_preset_add ( const char descr_name,
struct cm_parameter pparam 
)

◆ cmafec_preset_get_descr()

char * cmafec_preset_get_descr ( int  idx)

◆ cmafec_preset_get_index_of_parameter()

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 196 of file cma_fec.c.

Referenced by append_cma_to_menu_item(), cell_data_func(), cmafec_get_short_descr(), create_governor_menu(), select_cma_callback(), select_governor_callback(), and city_dialog::update_cma_tab().

◆ cmafec_preset_get_parameter()

const struct cm_parameter * cmafec_preset_get_parameter ( int  idx)

◆ cmafec_preset_num()

int cmafec_preset_num ( void  )

◆ cmafec_preset_remove()

void cmafec_preset_remove ( int  idx)

◆ cmafec_set_fe_parameter()

void cmafec_set_fe_parameter ( struct city pcity,
const struct cm_parameter *const  parameter 
)

◆ create_default_cma_presets()

void create_default_cma_presets ( void  )

Create default cma presets for a new user (or without configuration file)

Definition at line 384 of file cma_fec.c.