Freeciv-3.1
|
#include "fc_types.h"
#include "featured_text.h"
#include "events.h"
#include "unittype.h"
#include "unitlist.h"
Go to the source code of this file.
Data Structures | |
struct | item |
Macros | |
#define | cid_production cid_decode |
#define | MAX_NUM_PRODUCTION_TARGETS (U_LAST + B_LAST) |
Typedefs | |
typedef int | cid |
typedef bool(* | TestCityFunc) (const struct city *, const struct universal *) |
Enumerations | |
enum | unit_bg_color_type { UNIT_BG_HP_LOSS , UNIT_BG_LAND , UNIT_BG_SEA , UNIT_BG_AMPHIBIOUS , UNIT_BG_FLYING } |
Functions | |
void | client_remove_player (int plrno) |
void | client_remove_city (struct city *pcity) |
void | client_remove_unit (struct unit *punit) |
void | client_change_all (struct universal *from, struct universal *to) |
const char * | get_embassy_status (const struct player *me, const struct player *them) |
const char * | get_vision_status (const struct player *me, const struct player *them) |
void | client_diplomacy_clause_string (char *buf, int bufsiz, struct Clause *pclause) |
void | global_warming_scaled (int *chance, int *rate, int max) |
void | nuclear_winter_scaled (int *chance, int *rate, int max) |
struct sprite * | client_research_sprite (void) |
struct sprite * | client_warming_sprite (void) |
struct sprite * | client_cooling_sprite (void) |
struct sprite * | client_government_sprite (void) |
void | center_on_something (void) |
cid | cid_encode (struct universal target) |
cid | cid_encode_unit (const struct unit_type *punittype) |
cid | cid_encode_building (const struct impr_type *pimprove) |
cid | cid_encode_from_city (const struct city *pcity) |
struct universal | cid_decode (cid cid) |
bool | city_unit_supported (const struct city *pcity, const struct universal *target) |
bool | city_unit_present (const struct city *pcity, const struct universal *target) |
bool | city_building_present (const struct city *pcity, const struct universal *target) |
bool | can_city_build_now_client (const struct city *pcity, const struct universal *target) |
void | name_and_sort_items (struct universal *targets, int num_items, struct item *items, bool show_cost, struct city *pcity) |
int | collect_production_targets (struct universal *targets, struct city **selected_cities, int num_selected_cities, bool append_units, bool append_wonders, bool change_prod, TestCityFunc test_func) |
int | collect_currently_building_targets (struct universal *targets) |
int | collect_buildable_targets (struct universal *targets) |
int | collect_eventually_buildable_targets (struct universal *targets, struct city *pcity, bool advanced_tech) |
int | collect_already_built_targets (struct universal *targets, struct city *pcity) |
int | num_present_units_in_city (struct city *pcity) |
int | num_supported_units_in_city (struct city *pcity) |
void | handle_event (const char *featured_text, struct tile *ptile, enum event_type event, int turn, int phase, int conn_id) |
void | create_event (struct tile *ptile, enum event_type event, const struct ft_color color, const char *format,...) fc__attribute((__format__(__printf__ |
void struct city * | get_nearest_city (const struct unit *punit, int *sq_dist) |
void | cityrep_buy (struct city *pcity) |
void | common_taxrates_callback (int idx, bool reverse) |
bool | can_units_do_connect (struct unit_list *punits, enum unit_activity activity, struct extra_type *tgt) |
void | client_unit_init_act_prob_cache (struct unit *punit) |
enum unit_bg_color_type | unit_color_type (const struct unit_type *punittype) |
void | buy_production_in_selected_cities (void) |
void | unit_focus_set_status (struct player *pplayer) |
void | client_player_init (struct player *pplayer) |
void | client_player_maps_reset (void) |
bool | mapimg_client_define (void) |
bool | mapimg_client_createmap (const char *filename) |
struct nation_set * | client_current_nation_set (void) |
bool | client_nation_is_in_current_set (const struct nation_type *pnation) |
enum ai_level | server_ai_level (void) |
#define cid_production cid_decode |
enum unit_bg_color_type |
void buy_production_in_selected_cities | ( | void | ) |
For each selected city, buy the current production. The selected cities are sorted so production is bought in the cities with lowest cost first.
Definition at line 1310 of file climisc.c.
Referenced by key_press_map_canvas(), and key_press_map_canvas().
A TestCityFunc wrapper for can_city_build_now()
Definition at line 586 of file climisc.c.
Referenced by create_change_menu(), create_select_menu(), city_widget::display_list_menu(), city_widget::gen_select_labels(), popup_change_menu(), popup_first_menu(), popup_last_menu(), popup_next_menu(), popup_next_to_last_menu(), and popup_select_menu().
bool can_units_do_connect | ( | struct unit_list * | punits, |
enum unit_activity | activity, | ||
struct extra_type * | tgt | ||
) |
Returns TRUE if any of the units can do the connect activity.
Definition at line 1235 of file climisc.c.
Referenced by mr_menu::menus_sensitive(), real_menus_update(), and request_unit_connect().
void center_on_something | ( | void | ) |
Find something sensible to display. This is used to overwrite the intro gfx.
Definition at line 424 of file climisc.c.
Referenced by real_resize_window_callback(), real_set_client_page(), set_client_state(), and fc_client::switch_page().
Decode the CID into a city_production structure.
Definition at line 519 of file climisc.c.
Referenced by add_target_to_production(), add_target_to_worklist(), city_dialog::change_production(), collect_currently_building_targets(), collect_production_targets(), eco_report::disband_units(), city_widget::display_list_menu(), economy_report_command_callback(), economy_report_selection_callback(), get_target_help_data(), help_callback(), impr_or_unit_iterate(), select_impr_or_unit_callback(), select_impr_or_unit_callback(), eco_report::selection_changed(), eco_report::sell_buildings(), eco_report::sell_redundant(), swap_item_down_from_worklist(), wl_help_from_iter(), worklist_first_impr_or_unit_iterate(), worklist_last_impr_or_unit_iterate(), worklist_next_impr_or_unit_iterate(), and worklist_next_to_last_impr_or_unit_iterate().
Encode a CID for the target production.
Definition at line 476 of file climisc.c.
Referenced by add_target_to_production(), add_target_to_worklist(), append_impr_or_unit_to_menu(), append_impr_or_unit_to_menu_item(), city_dialog::change_production(), cid_encode_building(), cid_encode_from_city(), cid_encode_unit(), city_dialog_update_building(), city_widget::gen_production_labels(), menu_item_callback(), menu_item_callback(), popup_worklist_editor(), refresh_worklist(), select_impr_or_unit_callback(), and select_impr_or_unit_callback().
Encode a CID for the target building.
Definition at line 498 of file climisc.c.
Referenced by add_global_worklist(), economy_report_update(), popup_worklist_editor(), and eco_report::update_report().
Encode a CID for the target city's production.
Definition at line 511 of file climisc.c.
Referenced by collect_currently_building_targets().
Encode a CID for the target unit type.
Definition at line 486 of file climisc.c.
Referenced by add_global_worklist(), economy_report_update(), popup_worklist_editor(), and eco_report::update_report().
A TestCityFunc to tell whether the item is a building and is present.
Definition at line 576 of file climisc.c.
Referenced by create_select_menu(), city_widget::display_list_menu(), city_widget::gen_select_labels(), and popup_select_menu().
Return TRUE if the city has present at least one unit of the given production type (returns FALSE if the production is a building).
Definition at line 557 of file climisc.c.
Referenced by create_select_menu(), city_widget::display_list_menu(), city_widget::gen_select_labels(), and popup_select_menu().
Return TRUE if the city supports at least one unit of the given production type (returns FALSE if the production is a building).
Definition at line 538 of file climisc.c.
Referenced by create_select_menu(), city_widget::display_list_menu(), city_widget::gen_select_labels(), and popup_select_menu().
void cityrep_buy | ( | struct city * | pcity | ) |
Called when the "Buy" button is pressed in the city report for every selected city. Checks for coinage and sufficient funds or request the purchase if everything is ok.
Definition at line 1148 of file climisc.c.
Referenced by city_widget::buy(), and buy_iterate().
struct sprite * client_cooling_sprite | ( | void | ) |
Return the sprite for the global-cooling indicator.
Definition at line 388 of file climisc.c.
Referenced by setup_widgets(), show_game_page(), fc_sidewidget::update_final_pixmap(), fc_client::update_info_label(), and update_info_label().
struct nation_set * client_current_nation_set | ( | void | ) |
Returns the nation set in use.
Definition at line 1485 of file climisc.c.
Referenced by client_nation_is_in_current_set().
void client_diplomacy_clause_string | ( | char * | buf, |
int | bufsiz, | ||
struct Clause * | pclause | ||
) |
Copy a string that describes the given clause into the return buffer.
Definition at line 241 of file climisc.c.
Referenced by update_clauses_list(), update_diplomacy_dialog(), and diplo_wdg::update_wdg().
struct sprite * client_government_sprite | ( | void | ) |
Return the sprite for the government indicator.
Definition at line 406 of file climisc.c.
Referenced by popup_unitinfo_window(), fc_sidewidget::resize_pixmap(), setup_widgets(), fc_sidewidget::update_final_pixmap(), fc_client::update_info_label(), and update_info_label().
bool client_nation_is_in_current_set | ( | const struct nation_type * | pnation | ) |
Returns Whether 'pnation' is in the current nation set.
Mostly a client stub.
Definition at line 1502 of file climisc.c.
Referenced by extviewer_refresh_widgets(), and show_help_for_nation().
void client_player_init | ( | struct player * | pplayer | ) |
Initialize a player on the client side.
Definition at line 1366 of file climisc.c.
Referenced by handle_player_info().
void client_player_maps_reset | ( | void | ) |
Reset the private maps of all players.
Definition at line 1377 of file climisc.c.
Referenced by handle_map_info().
void client_remove_city | ( | struct city * | pcity | ) |
Remove city, client end version.
Definition at line 134 of file climisc.c.
Referenced by handle_city_info(), handle_city_remove(), and handle_city_short_info().
void client_remove_player | ( | int | plrno | ) |
void client_remove_unit | ( | struct unit * | punit | ) |
Remove unit, client end version
Definition at line 72 of file climisc.c.
Referenced by handle_unit_remove().
struct sprite * client_research_sprite | ( | void | ) |
Return the sprite for the research indicator.
Definition at line 348 of file climisc.c.
Referenced by popup_unitinfo_window(), setup_widgets(), fc_sidewidget::update_final_pixmap(), fc_client::update_info_label(), and update_info_label().
void client_unit_init_act_prob_cache | ( | struct unit * | punit | ) |
Initialize the action probability cache. Shouldn't be kept around permanently. Its data is quickly outdated.
Definition at line 1252 of file climisc.c.
Referenced by act_sel_done_primary(), diplomat_queue_handle_primary(), diplomat_queue_handle_primary(), and popup_action_selection().
struct sprite * client_warming_sprite | ( | void | ) |
Return the sprite for the global-warming indicator.
Definition at line 371 of file climisc.c.
Referenced by setup_widgets(), show_game_page(), fc_sidewidget::update_final_pixmap(), fc_client::update_info_label(), and update_info_label().
Collect the cids of all improvements which are built in the given city.
Definition at line 906 of file climisc.c.
Referenced by city_dialog_update_improvement_list(), and city_dialog::update_improvements().
int collect_buildable_targets | ( | struct universal * | targets | ) |
int collect_currently_building_targets | ( | struct universal * | targets | ) |
int collect_eventually_buildable_targets | ( | struct universal * | targets, |
struct city * | pcity, | ||
bool | advanced_tech | ||
) |
Collect the cids of all targets which can be build by this city or in general.
Definition at line 812 of file climisc.c.
Referenced by city_dialog::change_production(), city_dialog_update_building(), city_production_model::populate(), and refresh_worklist().
int collect_production_targets | ( | struct universal * | targets, |
struct city ** | selected_cities, | ||
int | num_selected_cities, | ||
bool | append_units, | ||
bool | append_wonders, | ||
bool | change_prod, | ||
TestCityFunc | test_func | ||
) |
Return possible production targets for the current player's cities.
FIXME: this should probably take a pplayer argument.
Definition at line 693 of file climisc.c.
Referenced by append_impr_or_unit_to_menu(), append_impr_or_unit_to_menu_item(), and city_widget::gen_production_labels().
void common_taxrates_callback | ( | int | idx, |
bool | reverse | ||
) |
Switch between tax/sci/lux at given slot.
Definition at line 1187 of file climisc.c.
Referenced by reverse_taxrates_callback(), taxrates_callback(), and taxrates_callback().
void create_event | ( | struct tile * | ptile, |
enum event_type | event, | ||
const struct ft_color | color, | ||
const char * | format, | ||
... | |||
) |
Return a string indicating one nation's embassy status with another
Definition at line 194 of file climisc.c.
Referenced by col_embassy().
Find city nearest to given unit and optionally return squared city distance Parameter sq_dist may be NULL. Returns NULL only if no city is known. Favors punit owner's cities over other cities if equally distant.
Definition at line 1112 of file climisc.c.
Referenced by create_present_supported_units_widget_list(), and unit_description().
Return a string indicating one nation's shaed vision status with another
Definition at line 222 of file climisc.c.
Referenced by col_vision().
void global_warming_scaled | ( | int * | chance, |
int * | rate, | ||
int | max | ||
) |
Return global warming chance and rate of change, scaled to max.
Definition at line 328 of file climisc.c.
Referenced by client_warming_sprite(), get_global_warming_tooltip(), and get_info_label_text_popup().
void handle_event | ( | const char * | featured_text, |
struct tile * | ptile, | ||
enum event_type | event, | ||
int | turn, | ||
int | phase, | ||
int | conn_id | ||
) |
Handles a chat or event message.
Definition at line 961 of file climisc.c.
Referenced by create_event(), handle_chat_msg(), and handle_early_chat_msg().
bool mapimg_client_createmap | ( | const char * | filename | ) |
bool mapimg_client_define | ( | void | ) |
Create a map image definition on the client.
Definition at line 1402 of file climisc.c.
Referenced by mapimg_client_createmap().
void name_and_sort_items | ( | struct universal * | targets, |
int | num_targets, | ||
struct item * | items, | ||
bool | show_cost, | ||
struct city * | pcity | ||
) |
Takes an array of compound ids (cids). It will fill out an array of struct items and also sort it.
section 0: normal buildings section 1: Capitalization section 2: UTYF_CIVILIAN units section 3: other units section 4: small wonders section 5: great wonders
Definition at line 643 of file climisc.c.
Referenced by append_impr_or_unit_to_menu(), append_impr_or_unit_to_menu_item(), city_dialog::change_production(), city_dialog_update_building(), city_dialog_update_improvement_list(), city_widget::gen_production_labels(), city_production_model::populate(), refresh_worklist(), and city_dialog::update_improvements().
void nuclear_winter_scaled | ( | int * | chance, |
int * | rate, | ||
int | max | ||
) |
Return nuclear winter chance and rate of change, scaled to max.
Definition at line 338 of file climisc.c.
Referenced by client_cooling_sprite(), get_info_label_text_popup(), and get_nuclear_winter_tooltip().
int num_present_units_in_city | ( | struct city * | pcity | ) |
int num_supported_units_in_city | ( | struct city * | pcity | ) |
enum ai_level server_ai_level | ( | void | ) |
Returns the current AI skill level on the server, if the same level is currently used for all current AI players and will be for new ones; else return ai_level_invalid() to indicate inconsistency.
Definition at line 1512 of file climisc.c.
Referenced by ai_skill_callback(), pregame_options::ailevel_change(), real_conn_list_dialog_update(), and pregame_options::update_ai_level().
enum unit_bg_color_type unit_color_type | ( | const struct unit_type * | punittype | ) |
Determines which color type should be used for unit background. This is only guesswork based on unit properties. One should not take UNIT_BG_FLYING seriously meaning that unit can fly - custom ruleset might have units with similar properties but explains these properties by some other means than by flying.
void unit_focus_set_status | ( | struct player * | pplayer | ) |
Set focus status of all player units to FOCUS_AVAIL.
Definition at line 1356 of file climisc.c.
Referenced by handle_start_phase().