![]() |
Freeciv21
Develop your civilization from humble roots to a global empire
|
#include "fcintl.h"#include "log.h"#include "city.h"#include "effects.h"#include "game.h"#include "specialist.h"
Include dependency graph for specialist.cpp:Go to the source code of this file.
Functions | |
| void | specialists_init () |
| Initialize data for specialists. More... | |
| void | specialists_free () |
| Free data for specialists. More... | |
| Specialist_type_id | specialist_count () |
| Return the number of specialist_types. More... | |
| Specialist_type_id | specialist_index (const struct specialist *sp) |
| Return the specialist index. More... | |
| Specialist_type_id | specialist_number (const struct specialist *sp) |
| Return the specialist item_number. More... | |
| struct specialist * | specialist_by_number (const Specialist_type_id id) |
| Return the specialist pointer for the given number. More... | |
| struct specialist * | specialist_by_rule_name (const char *name) |
| Return the specialist type with the given (untranslated!) rule name. More... | |
| struct specialist * | specialist_by_translated_name (const char *name) |
| Return the specialist type with the given (translated, plural) name. More... | |
| const char * | specialist_rule_name (const struct specialist *sp) |
| Return the (untranslated) rule name of the specialist type. More... | |
| const char * | specialist_plural_translation (const struct specialist *sp) |
| Return the (translated, plural) name of the specialist type. More... | |
| const char * | specialist_abbreviation_translation (const struct specialist *sp) |
| Return the (translated) abbreviation of the specialist type. More... | |
| const char * | specialists_abbreviation_string () |
| Return a string containing all the specialist abbreviations, for instance "E/S/T". More... | |
| const char * | specialists_string (const citizens *specialist_list) |
| Return a string showing the number of specialists in the array. More... | |
| int | get_specialist_output (const struct city *pcity, Specialist_type_id sp, Output_type_id otype) |
| Return the output for the specialist type with this output type. More... | |
Variables | |
| struct specialist | specialists [SP_MAX] |
| int | default_specialist |
| int get_specialist_output | ( | const struct city * | pcity, |
| Specialist_type_id | sp, | ||
| Output_type_id | otype | ||
| ) |
Return the output for the specialist type with this output type.
Definition at line 218 of file specialist.cpp.
Referenced by add_specialist_output(), best_specialist(), dai_set_defenders(), get_entertainers(), init_specialist_lattice_nodes(), and military_advisor_choose_build().
| const char* specialist_abbreviation_translation | ( | const struct specialist * | sp | ) |
Return the (translated) abbreviation of the specialist type.
You don't have to free the return pointer.
Definition at line 160 of file specialist.cpp.
Referenced by init_city_report_game_data(), and specialists_abbreviation_string().
| struct specialist* specialist_by_number | ( | const Specialist_type_id | id | ) |
Return the specialist pointer for the given number.
Definition at line 92 of file specialist.cpp.
Referenced by boot_help_texts(), city_can_use_specialist(), compat_load_020600(), get_city_dialog_size_text(), handle_ruleset_specialist(), init_city_report_game_data(), is_universal_needed(), load_ruleset_cities(), sanity_check_ruleset_data(), save_cities_ruleset(), send_ruleset_specialists(), sg_save_savefile(), specialist_by_rule_name(), specialist_by_translated_name(), specialists_abbreviation_string(), tileset_setup_specialist_type(), and universal_value_initial().
| struct specialist* specialist_by_rule_name | ( | const char * | name | ) |
Return the specialist type with the given (untranslated!) rule name.
Returns nullptr if none match.
Definition at line 104 of file specialist.cpp.
Referenced by sg_load_savefile(), and universal_by_number().
| struct specialist* specialist_by_translated_name | ( | const char * | name | ) |
Return the specialist type with the given (translated, plural) name.
Returns nullptr if none match.
Definition at line 124 of file specialist.cpp.
Referenced by help_widget::set_topic_specialist().
| Specialist_type_id specialist_count | ( | ) |
Return the number of specialist_types.
Definition at line 63 of file specialist.cpp.
Referenced by city_rotate_specialist(), compat_load_020600(), handle_city_change_specialist(), init_city_report_game_data(), package_city(), and sg_save_savefile().
| Specialist_type_id specialist_index | ( | const struct specialist * | sp | ) |
Return the specialist index.
Currently same as specialist_number(), paired with specialist_count() indicates use as an array index.
Definition at line 74 of file specialist.cpp.
Referenced by cr_entry_specialist(), sg_load_player_city(), and sg_load_player_main().
| Specialist_type_id specialist_number | ( | const struct specialist * | sp | ) |
Return the specialist item_number.
Definition at line 83 of file specialist.cpp.
Referenced by universal_number().
| const char* specialist_plural_translation | ( | const struct specialist * | sp | ) |
Return the (translated, plural) name of the specialist type.
You don't have to free the return pointer.
Definition at line 151 of file specialist.cpp.
Referenced by boot_help_texts(), get_city_dialog_size_text(), init_city_report_game_data(), req_text_insert(), specialist_by_translated_name(), and universal_name_translation().
| const char* specialist_rule_name | ( | const struct specialist * | sp | ) |
Return the (untranslated) rule name of the specialist type.
You don't have to free the return pointer.
Definition at line 142 of file specialist.cpp.
Referenced by compat_load_020600(), init_city_report_game_data(), is_universal_needed(), load_ruleset_cities(), sanity_check_ruleset_data(), sg_save_savefile(), specialist_by_rule_name(), universal_kind_values(), and universal_rule_name().
| const char* specialists_abbreviation_string | ( | ) |
Return a string containing all the specialist abbreviations, for instance "E/S/T".
You don't have to free the return pointer.
Definition at line 170 of file specialist.cpp.
Referenced by init_city_report_game_data().
| void specialists_free | ( | ) |
Free data for specialists.
Definition at line 47 of file specialist.cpp.
Referenced by game_ruleset_free().
| void specialists_init | ( | ) |
Initialize data for specialists.
Definition at line 30 of file specialist.cpp.
Referenced by game_ruleset_init().
| const char* specialists_string | ( | const citizens * | specialist_list | ) |
Return a string showing the number of specialists in the array.
For instance with a city with (0,3,1) specialists call
specialists_string(pcity->specialists);
and you'll get "0/3/1".
Definition at line 198 of file specialist.cpp.
Referenced by cm_print_city(), cm_print_result(), and cr_entry_specialists().
| int default_specialist |
Definition at line 25 of file specialist.cpp.
| struct specialist specialists[SP_MAX] |
Definition at line 1 of file specialist.cpp.
Referenced by get_specialist_output(), specialist_by_number(), specialist_index(), specialists_free(), and specialists_init().