Freeciv-3.3
Loading...
Searching...
No Matches
Data Structures | Macros | Enumerations | Functions
nation.h File Reference
#include "iterator.h"
#include "fc_types.h"
#include "name_translation.h"
#include "terrain.h"
#include "speclist.h"
#include "spechash.h"

Go to the source code of this file.

Data Structures

struct  nation_type
 
struct  nation_group
 

Macros

#define NO_NATION_SELECTED   (NULL)
 
#define NATION_NONE   -1
 
#define NATION_ANY   -2
 
#define SPECLIST_TAG   nation_city
 
#define SPECLIST_TYPE   struct nation_city
 
#define nation_city_list_iterate(citylist, pncity)    TYPED_LIST_ITERATE(struct nation_city, citylist, pncity)
 
#define nation_city_list_iterate_end   LIST_ITERATE_END
 
#define SPECLIST_TAG   nation_leader
 
#define SPECLIST_TYPE   struct nation_leader
 
#define nation_leader_list_iterate(leaderlist, pleader)    TYPED_LIST_ITERATE(struct nation_leader, leaderlist, pleader)
 
#define nation_leader_list_iterate_end   LIST_ITERATE_END
 
#define SPECLIST_TAG   nation_set
 
#define SPECLIST_TYPE   struct nation_set
 
#define nation_set_list_iterate(setlist, pset)    TYPED_LIST_ITERATE(struct nation_set, setlist, pset)
 
#define nation_set_list_iterate_end   LIST_ITERATE_END
 
#define SPECLIST_TAG   nation_group
 
#define SPECLIST_TYPE   struct nation_group
 
#define nation_group_list_iterate(grouplist, pgroup)    TYPED_LIST_ITERATE(struct nation_group, grouplist, pgroup)
 
#define nation_group_list_iterate_end   LIST_ITERATE_END
 
#define SPECLIST_TAG   nation
 
#define SPECLIST_TYPE   struct nation_type
 
#define nation_list_iterate(nationlist, pnation)    TYPED_LIST_ITERATE(struct nation_type, nationlist, pnation)
 
#define nation_list_iterate_end   LIST_ITERATE_END
 
#define SPECHASH_TAG   nation
 
#define SPECHASH_IKEY_TYPE   struct nation_type *
 
#define SPECHASH_IDATA_TYPE   void *
 
#define nation_hash_iterate(nationhash, pnation)    TYPED_HASH_KEYS_ITERATE(struct nation_type *, nationhash, pnation)
 
#define nation_hash_iterate_end   HASH_KEYS_ITERATE_END
 
#define nation_sets_iterate(NAME_pset)
 
#define nation_sets_iterate_end   generic_iterate_end
 
#define nation_groups_iterate(NAME_pgroup)
 
#define nation_groups_iterate_end   generic_iterate_end
 
#define nations_iterate(NAME_pnation)
 
#define nations_iterate_end   generic_iterate_end
 
#define nations_re_active_iterate(_pnat_)    nations_iterate(_pnat_)
 
#define nations_re_active_iterate_end    nations_iterate_end;
 

Enumerations

enum  nation_city_preference { NCP_DISLIKE = -1 , NCP_NONE = 0 , NCP_LIKE = 1 }
 

Functions

Nation_type_id nation_count (void)
 
Nation_type_id nation_index (const struct nation_type *pnation)
 
Nation_type_id nation_number (const struct nation_type *pnation)
 
struct nation_typenation_by_number (const Nation_type_id nation)
 
struct nation_typenation_of_player (const struct player *pplayer)
 
struct nation_typenation_of_city (const struct city *pcity)
 
struct nation_typenation_of_unit (const struct unit *punit)
 
struct nation_typenation_by_rule_name (const char *name)
 
struct nation_typenation_by_translated_plural (const char *name)
 
const charnation_rule_name (const struct nation_type *pnation)
 
const charnation_adjective_translation (const struct nation_type *pnation)
 
const charnation_adjective_for_player (const struct player *pplayer)
 
const charnation_plural_translation (const struct nation_type *pnation)
 
const charnation_plural_for_player (const struct player *pplayer)
 
struct governmentinit_government_of_nation (const struct nation_type *pnation)
 
struct nation_stylestyle_of_nation (const struct nation_type *pnation)
 
const struct rgbcolornation_color (const struct nation_type *pnation)
 
bool is_nation_pickable (const struct nation_type *nation)
 
bool is_nation_playable (const struct nation_type *nation)
 
enum barbarian_type nation_barbarian_type (const struct nation_type *nation)
 
bool can_conn_edit_players_nation (const struct connection *pconn, const struct player *pplayer)
 
const struct nation_leader_listnation_leaders (const struct nation_type *pnation)
 
struct nation_leadernation_leader_new (struct nation_type *pnation, const char *name, bool is_male)
 
struct nation_leadernation_leader_by_name (const struct nation_type *pnation, const char *name)
 
const charnation_leader_name (const struct nation_leader *pleader)
 
bool nation_leader_is_male (const struct nation_leader *pleader)
 
const charnation_legend_translation (const struct nation_type *pnation, const char *legend)
 
const struct nation_city_listnation_cities (const struct nation_type *pnation)
 
struct nation_citynation_city_new (struct nation_type *pnation, const char *name)
 
const charnation_city_name (const struct nation_city *pncity)
 
enum nation_city_preference nation_city_preference_revert (enum nation_city_preference prefer)
 
void nation_city_set_terrain_preference (struct nation_city *pncity, const struct terrain *pterrain, enum nation_city_preference prefer)
 
void nation_city_set_river_preference (struct nation_city *pncity, enum nation_city_preference prefer)
 
enum nation_city_preference nation_city_terrain_preference (const struct nation_city *pncity, const struct terrain *pterrain)
 
enum nation_city_preference nation_city_river_preference (const struct nation_city *pncity)
 
int nation_set_count (void)
 
int nation_set_index (const struct nation_set *pset)
 
int nation_set_number (const struct nation_set *pset)
 
struct nation_setnation_set_new (const char *set_name, const char *set_rule_name, const char *set_description)
 
struct nation_setnation_set_by_number (int id)
 
struct nation_setnation_set_by_rule_name (const char *name)
 
const charnation_set_untranslated_name (const struct nation_set *pset)
 
const charnation_set_rule_name (const struct nation_set *pset)
 
const charnation_set_name_translation (const struct nation_set *pset)
 
const charnation_set_description (const struct nation_set *pset)
 
bool nation_is_in_set (const struct nation_type *pnation, const struct nation_set *pset)
 
struct nation_setnation_set_by_setting_value (const char *setting)
 
int nation_group_count (void)
 
int nation_group_index (const struct nation_group *pgroup)
 
int nation_group_number (const struct nation_group *pgroup)
 
struct nation_groupnation_group_new (const char *name)
 
struct nation_groupnation_group_by_number (int id)
 
struct nation_groupnation_group_by_rule_name (const char *name)
 
void nation_group_set_hidden (struct nation_group *pgroup, bool hidden)
 
void nation_group_set_match (struct nation_group *pgroup, int match)
 
bool is_nation_group_hidden (struct nation_group *pgroup)
 
const charnation_group_untranslated_name (const struct nation_group *pgroup)
 
const charnation_group_rule_name (const struct nation_group *pgroup)
 
const charnation_group_name_translation (const struct nation_group *pgroup)
 
bool nation_is_in_group (const struct nation_type *pnation, const struct nation_group *pgroup)
 
void nation_sets_groups_init (void)
 
void nation_sets_groups_free (void)
 
size_t nation_set_iter_sizeof (void)
 
struct iteratornation_set_iter_init (struct nation_set_iter *it)
 
size_t nation_group_iter_sizeof (void)
 
struct iteratornation_group_iter_init (struct nation_group_iter *it)
 
void nations_alloc (int num)
 
void nations_free (void)
 
int nations_match (const struct nation_type *pnation1, const struct nation_type *pnation2, bool ignore_conflicts)
 
size_t nation_iter_sizeof (void)
 
struct iteratornation_iter_init (struct nation_iter *it)
 

Macro Definition Documentation

◆ NATION_ANY

#define NATION_ANY   -2

Definition at line 34 of file nation.h.

◆ nation_city_list_iterate

#define nation_city_list_iterate (   citylist,
  pncity 
)     TYPED_LIST_ITERATE(struct nation_city, citylist, pncity)

Definition at line 48 of file nation.h.

◆ nation_city_list_iterate_end

#define nation_city_list_iterate_end   LIST_ITERATE_END

Definition at line 50 of file nation.h.

◆ nation_group_list_iterate

#define nation_group_list_iterate (   grouplist,
  pgroup 
)     TYPED_LIST_ITERATE(struct nation_group, grouplist, pgroup)

Definition at line 75 of file nation.h.

◆ nation_group_list_iterate_end

#define nation_group_list_iterate_end   LIST_ITERATE_END

Definition at line 77 of file nation.h.

◆ nation_groups_iterate

#define nation_groups_iterate (   NAME_pgroup)
Value:
char * incite_cost
Definition comments.c:76
#define generic_iterate(TYPE_it, TYPE_a, NAME_a, FUNC_size, FUNC_init,...)
Definition iterator.h:117
struct iterator * nation_group_iter_init(struct nation_group_iter *it)
Definition nation.c:1157
size_t nation_group_iter_sizeof(void)
Definition nation.c:1124

Definition at line 311 of file nation.h.

◆ nation_groups_iterate_end

#define nation_groups_iterate_end   generic_iterate_end

Definition at line 315 of file nation.h.

◆ nation_hash_iterate

#define nation_hash_iterate (   nationhash,
  pnation 
)     TYPED_HASH_KEYS_ITERATE(struct nation_type *, nationhash, pnation)

Definition at line 93 of file nation.h.

◆ nation_hash_iterate_end

#define nation_hash_iterate_end   HASH_KEYS_ITERATE_END

Definition at line 95 of file nation.h.

◆ nation_leader_list_iterate

#define nation_leader_list_iterate (   leaderlist,
  pleader 
)     TYPED_LIST_ITERATE(struct nation_leader, leaderlist, pleader)

Definition at line 57 of file nation.h.

◆ nation_leader_list_iterate_end

#define nation_leader_list_iterate_end   LIST_ITERATE_END

Definition at line 59 of file nation.h.

◆ nation_list_iterate

#define nation_list_iterate (   nationlist,
  pnation 
)     TYPED_LIST_ITERATE(struct nation_type, nationlist, pnation)

Definition at line 84 of file nation.h.

◆ nation_list_iterate_end

#define nation_list_iterate_end   LIST_ITERATE_END

Definition at line 86 of file nation.h.

◆ NATION_NONE

#define NATION_NONE   -1

Definition at line 33 of file nation.h.

◆ nation_set_list_iterate

#define nation_set_list_iterate (   setlist,
  pset 
)     TYPED_LIST_ITERATE(struct nation_set, setlist, pset)

Definition at line 66 of file nation.h.

◆ nation_set_list_iterate_end

#define nation_set_list_iterate_end   LIST_ITERATE_END

Definition at line 68 of file nation.h.

◆ nation_sets_iterate

#define nation_sets_iterate (   NAME_pset)
Value:
struct iterator * nation_set_iter_init(struct nation_set_iter *it)
Definition nation.c:922
size_t nation_set_iter_sizeof(void)
Definition nation.c:889

Definition at line 301 of file nation.h.

◆ nation_sets_iterate_end

#define nation_sets_iterate_end   generic_iterate_end

Definition at line 305 of file nation.h.

◆ nations_iterate

#define nations_iterate (   NAME_pnation)
Value:
struct iterator * nation_iter_init(struct nation_iter *it)
Definition nation.c:557
size_t nation_iter_sizeof(void)
Definition nation.c:524

Definition at line 333 of file nation.h.

◆ nations_iterate_end

#define nations_iterate_end   generic_iterate_end

Definition at line 336 of file nation.h.

◆ nations_re_active_iterate

#define nations_re_active_iterate (   _pnat_)     nations_iterate(_pnat_)

Definition at line 339 of file nation.h.

◆ nations_re_active_iterate_end

#define nations_re_active_iterate_end    nations_iterate_end;

Definition at line 342 of file nation.h.

◆ NO_NATION_SELECTED

#define NO_NATION_SELECTED   (NULL)

Definition at line 30 of file nation.h.

◆ SPECHASH_IDATA_TYPE

#define SPECHASH_IDATA_TYPE   void *

Definition at line 91 of file nation.h.

◆ SPECHASH_IKEY_TYPE

#define SPECHASH_IKEY_TYPE   struct nation_type *

Definition at line 90 of file nation.h.

◆ SPECHASH_TAG

#define SPECHASH_TAG   nation

Definition at line 89 of file nation.h.

◆ SPECLIST_TAG [1/5]

#define SPECLIST_TAG   nation_city

Definition at line 45 of file nation.h.

◆ SPECLIST_TAG [2/5]

#define SPECLIST_TAG   nation_leader

Definition at line 45 of file nation.h.

◆ SPECLIST_TAG [3/5]

#define SPECLIST_TAG   nation_set

Definition at line 45 of file nation.h.

◆ SPECLIST_TAG [4/5]

#define SPECLIST_TAG   nation_group

Definition at line 45 of file nation.h.

◆ SPECLIST_TAG [5/5]

#define SPECLIST_TAG   nation

Definition at line 45 of file nation.h.

◆ SPECLIST_TYPE [1/5]

#define SPECLIST_TYPE   struct nation_city

Definition at line 46 of file nation.h.

◆ SPECLIST_TYPE [2/5]

#define SPECLIST_TYPE   struct nation_leader

Definition at line 46 of file nation.h.

◆ SPECLIST_TYPE [3/5]

#define SPECLIST_TYPE   struct nation_set

Definition at line 46 of file nation.h.

◆ SPECLIST_TYPE [4/5]

#define SPECLIST_TYPE   struct nation_group

Definition at line 46 of file nation.h.

◆ SPECLIST_TYPE [5/5]

#define SPECLIST_TYPE   struct nation_type

Definition at line 46 of file nation.h.

Enumeration Type Documentation

◆ nation_city_preference

Enumerator
NCP_DISLIKE 
NCP_NONE 
NCP_LIKE 

Definition at line 39 of file nation.h.

Function Documentation

◆ can_conn_edit_players_nation()

bool can_conn_edit_players_nation ( const struct connection pconn,
const struct player pplayer 
)

Return TRUE iff the editor is allowed to edit the player's nation in pregame.

Definition at line 1187 of file nation.c.

Referenced by create_conn_menu(), handle_nation_select_req(), and fc_client::start_page_menu().

◆ init_government_of_nation()

struct government * init_government_of_nation ( const struct nation_type pnation)

Returns initial government type for this nation. Always returns non-NULL – nation-specific government or failing that ruleset default government.

Definition at line 659 of file nation.c.

Referenced by create_animals(), create_barbarian_player(), create_command_newcomer(), dai_manage_government(), final_ruleset_adjustments(), handle_edit_player_create(), and split_player().

◆ is_nation_group_hidden()

bool is_nation_group_hidden ( struct nation_group pgroup)

Return whether this group should appear in the nation selection UI.

Definition at line 1057 of file nation.c.

Referenced by create_nation_selection_lists(), create_races_dialog(), and races_dialog::refresh().

◆ is_nation_pickable()

bool is_nation_pickable ( const struct nation_type nation)

Return whether a nation is "pickable" – whether players can select it at game start. (Client only function – on the server, use client_can_pick_nation().)

Definition at line 188 of file nation.c.

Referenced by create_list_of_nations_in_group(), get_playable_nation_count(), popup_races_dialog(), races_toggles_set_sensitive(), races_update_pickable(), races_dialog::refresh(), and races_dialog::set_index().

◆ is_nation_playable()

bool is_nation_playable ( const struct nation_type nation)

Return whether a nation is "playable"; i.e., whether a human player can choose this nation. Barbarian and observer nations are not playable.

This does not check whether a nation is "used" or "available".

Definition at line 200 of file nation.c.

Referenced by client_can_pick_nation(), count_playable_nations(), create_list_of_nations_in_group(), create_races_dialog(), extviewer_refresh_widgets(), generate_players(), handle_edit_player(), load_ruleset_nations(), pick_a_nation(), popup_races_dialog(), races_dialog::refresh(), races_dialog::set_index(), and show_nationsets().

◆ nation_adjective_for_player()

const char * nation_adjective_for_player ( const struct player pplayer)

Return the (translated) adjective for the given nation of a player. You don't have to free the return pointer.

Definition at line 169 of file nation.c.

Referenced by announce_trade_route_removal(), check_city_migrations_player(), check_for_game_over(), col_nation(), col_nation(), collect_ransom(), cr_entry_nation(), debug_command(), diplomat_bribe_unit(), diplomat_get_tech(), diplomat_incite(), diplomat_infiltrate_tile(), diplomat_sabotage(), do_attack(), do_capture_units(), do_city_migration(), do_expel_unit(), do_heal_unit(), do_nuke_tile(), do_wipe_units(), endgame_report_dialog_player(), get_full_nation(), get_report_title(), get_unit_info_label_text2(), handle_diplomacy_accept_treaty_req(), kill_unit(), plr_widget::nation_selected(), notify_actor_caught(), notify_actor_success(), notify_illegal_armistice_units(), player_loot_player(), players_war_callback(), players_war_callback(), popup_action_selection(), popup_advanced_terrain_dialog(), popup_diplomacy_dialog(), popup_diplomatic_objects(), popup_goto_airlift_dialog(), popup_info_text(), popup_players_nations_dialog(), popup_spaceship_dialog(), popup_war_dialog(), real_conn_list_dialog_update(), redraw_unit_info_label(), report_achievements(), report_demographics(), report_top_cities(), report_wonders_of_the_world(), report_wonders_of_the_world_long(), score_tooltip(), show_players(), spaceship_arrived(), spaceship_lost(), spy_nuke_city(), spy_poison(), spy_sabotage_unit(), spy_spread_plague(), spy_steal_gold(), spy_steal_some_maps(), tgt_extra_descr(), transfer_unit(), unit_bombard(), unit_description(), unit_do_help_build(), unit_select_dialog_popup(), pregame_options::update_buttons(), update_diplomacy_dialog(), update_info_label(), update_intel_dialog(), update_intel_wonder_dialog(), city_dialog::update_nation_table(), and fc_client::update_start_page().

◆ nation_adjective_translation()

const char * nation_adjective_translation ( const struct nation_type pnation)

◆ nation_barbarian_type()

enum barbarian_type nation_barbarian_type ( const struct nation_type nation)

Returns which kind of barbarians can use this nation.

This does not check whether a nation is "used" or "available".

Definition at line 211 of file nation.c.

Referenced by assign_player_colors(), extviewer_refresh_widgets(), handle_edit_player(), hard_code_oblig_hard_reqs_ruleset(), load_ruleset_nations(), pick_a_nation(), sanity_check_ruleset_data(), and update_nations_with_startpos().

◆ nation_by_number()

struct nation_type * nation_by_number ( const Nation_type_id  nation)

◆ nation_by_rule_name()

struct nation_type * nation_by_rule_name ( const char name)

Returns the nation that has the given (untranslated) rule name (adjective). Returns NO_NATION_SELECTED if none match.

Definition at line 121 of file nation.c.

Referenced by api_find_nation_type_by_name(), load_ruleset_nations(), playernation_command(), sanity_check_ruleset_data(), save_nations_ruleset(), sg_load_map_startpos(), sg_load_map_startpos(), sg_load_player_main(), sg_load_player_main(), and universal_value_from_str().

◆ nation_by_translated_plural()

struct nation_type * nation_by_translated_plural ( const char name)

Returns the nation that has the given (translated) plural noun. Returns NO_NATION_SELECTED if none match.

Definition at line 106 of file nation.c.

Referenced by help_update_dialog(), help_dialog::make_tree(), and help_widget::set_topic_nation().

◆ nation_cities()

const struct nation_city_list * nation_cities ( const struct nation_type pnation)

Return the default cities of the nation (server only function).

Definition at line 331 of file nation.c.

Referenced by city_name_suggestion(), and is_default_city_name().

◆ nation_city_name()

const char * nation_city_name ( const struct nation_city pncity)

Return the name of the default nation city.

Definition at line 412 of file nation.c.

Referenced by is_default_city_name(), save_nation(), and search_for_city_name().

◆ nation_city_new()

struct nation_city * nation_city_new ( struct nation_type pnation,
const char name 
)

Create a new default city for the nation (server only function).

Definition at line 342 of file nation.c.

Referenced by load_city_name_list().

◆ nation_city_preference_revert()

enum nation_city_preference nation_city_preference_revert ( enum nation_city_preference  prefer)

Reverts the nation city preference.

Definition at line 371 of file nation.c.

Referenced by evaluate_city_name_priority().

◆ nation_city_river_preference()

enum nation_city_preference nation_city_river_preference ( const struct nation_city pncity)

Return the default nation city preference for rivers.

Definition at line 434 of file nation.c.

Referenced by evaluate_city_name_priority(), and save_nation().

◆ nation_city_set_river_preference()

void nation_city_set_river_preference ( struct nation_city pncity,
enum nation_city_preference  prefer 
)

Set the default nation city preference about rivers.

Definition at line 402 of file nation.c.

Referenced by load_city_name_list().

◆ nation_city_set_terrain_preference()

void nation_city_set_terrain_preference ( struct nation_city pncity,
const struct terrain pterrain,
enum nation_city_preference  prefer 
)

Set the default nation city preference for the terrain.

Definition at line 390 of file nation.c.

Referenced by load_city_name_list().

◆ nation_city_terrain_preference()

enum nation_city_preference nation_city_terrain_preference ( const struct nation_city pncity,
const struct terrain pterrain 
)

Return the default nation city preference for the terrain.

Definition at line 422 of file nation.c.

Referenced by evaluate_city_name_priority(), and save_nation().

◆ nation_color()

const struct rgbcolor * nation_color ( const struct nation_type pnation)

Returns nation's player color preference, or NULL if none. Server only function.

Definition at line 682 of file nation.c.

Referenced by assign_player_colors(), player_preferred_color(), and plrcol_validate().

◆ nation_count()

Nation_type_id nation_count ( void  )

◆ nation_group_by_number()

struct nation_group * nation_group_by_number ( int  id)

Return the nation group with the given index.

This function returns NULL for an out-of-range index (some callers rely on this).

Definition at line 1004 of file nation.c.

Referenced by create_nation_selection_lists(), handle_ruleset_nation(), races_dialog::refresh(), races_dialog::set_index(), universal_by_number(), and universal_value_initial().

◆ nation_group_by_rule_name()

struct nation_group * nation_group_by_rule_name ( const char name)

Return the nation group that has the given (untranslated) rule name. Returns NULL if no group is found.

Definition at line 1021 of file nation.c.

Referenced by load_ruleset_nations(), nation_group_new(), nation_set_new(), and universal_value_from_str().

◆ nation_group_count()

int nation_group_count ( void  )

◆ nation_group_index()

int nation_group_index ( const struct nation_group pgroup)

Return the nation group index.

Definition at line 943 of file nation.c.

Referenced by handle_ruleset_nation_groups(), and nation_group_number().

◆ nation_group_iter_init()

struct iterator * nation_group_iter_init ( struct nation_group_iter it)

Implementation of iterator 'init' function.

Definition at line 1157 of file nation.c.

◆ nation_group_iter_sizeof()

size_t nation_group_iter_sizeof ( void  )

Implementation of iterator 'sizeof' function.

Definition at line 1124 of file nation.c.

◆ nation_group_name_translation()

const char * nation_group_name_translation ( const struct nation_group pgroup)

Return the translated name of a nation group. You don't have to free the return pointer.

Definition at line 1090 of file nation.c.

Referenced by create_nation_selection_lists(), races_dialog::refresh(), req_text_insert(), universal_name_translation(), and worklist_item_postpone_req_vec().

◆ nation_group_new()

struct nation_group * nation_group_new ( const char name)

Add new group into the array of groups.

Definition at line 960 of file nation.c.

Referenced by handle_ruleset_nation_groups(), and load_nation_names().

◆ nation_group_number()

int nation_group_number ( const struct nation_group pgroup)

Return the nation group index.

Definition at line 952 of file nation.c.

Referenced by send_ruleset_nations(), and universal_number().

◆ nation_group_rule_name()

const char * nation_group_rule_name ( const struct nation_group pgroup)

Return the (untranslated) rule name of a nation group. You don't have to free the return pointer.

Definition at line 1079 of file nation.c.

Referenced by save_nation(), universal_kind_values(), and universal_rule_name().

◆ nation_group_set_hidden()

void nation_group_set_hidden ( struct nation_group pgroup,
bool  hidden 
)

Set whether this group should appear in the nation selection UI.

Definition at line 1037 of file nation.c.

Referenced by load_ruleset_nations().

◆ nation_group_set_match()

void nation_group_set_match ( struct nation_group pgroup,
int  match 
)

Set how much the AI will try to select a nation in the same group. Server only function.

Definition at line 1047 of file nation.c.

Referenced by load_ruleset_nations().

◆ nation_group_untranslated_name()

const char * nation_group_untranslated_name ( const struct nation_group pgroup)

Return the untranslated name of a nation group (including qualifier, if any). You usually want nation_group_rule_name() instead. You don't have to free the return pointer.

Definition at line 1069 of file nation.c.

Referenced by send_ruleset_nations().

◆ nation_index()

Nation_type_id nation_index ( const struct nation_type pnation)

◆ nation_is_in_group()

bool nation_is_in_group ( const struct nation_type pnation,
const struct nation_group pgroup 
)

◆ nation_is_in_set()

bool nation_is_in_set ( const struct nation_type pnation,
const struct nation_set pset 
)

◆ nation_iter_init()

struct iterator * nation_iter_init ( struct nation_iter it)

Implementation of iterator 'init' function.

Definition at line 557 of file nation.c.

Referenced by startpos_iter_init().

◆ nation_iter_sizeof()

size_t nation_iter_sizeof ( void  )

Implementation of iterator 'sizeof' function.

Definition at line 524 of file nation.c.

Referenced by startpos_iter_sizeof().

◆ nation_leader_by_name()

struct nation_leader * nation_leader_by_name ( const struct nation_type pnation,
const char name 
)

Returns the nation leader structure which match 'name' or NULL if not found.

Definition at line 267 of file nation.c.

Referenced by generate_players(), player_nation_defaults(), races_leader_callback(), and server_player_name_is_allowed().

◆ nation_leader_is_male()

bool nation_leader_is_male ( const struct nation_leader pleader)

◆ nation_leader_name()

const char * nation_leader_name ( const struct nation_leader pleader)

◆ nation_leader_new()

struct nation_leader * nation_leader_new ( struct nation_type pnation,
const char name,
bool  is_male 
)

Create a new leader for the nation.

Definition at line 239 of file nation.c.

Referenced by handle_ruleset_nation(), and load_ruleset_nations().

◆ nation_leaders()

const struct nation_leader_list * nation_leaders ( const struct nation_type pnation)

◆ nation_legend_translation()

const char * nation_legend_translation ( const struct nation_type pnation,
const char legend 
)

Return translated version of nation legend.

Definition at line 299 of file nation.c.

Referenced by handle_ruleset_nation().

◆ nation_number()

Nation_type_id nation_number ( const struct nation_type pnation)

◆ nation_of_city()

struct nation_type * nation_of_city ( const struct city pcity)

◆ nation_of_player()

struct nation_type * nation_of_player ( const struct player pplayer)

◆ nation_of_unit()

struct nation_type * nation_of_unit ( const struct unit punit)

◆ nation_plural_for_player()

const char * nation_plural_for_player ( const struct player pplayer)

Return the (translated) plural noun of the given nation of a player. You don't have to free the return pointer.

Definition at line 178 of file nation.c.

Referenced by diplo_dlg::add_widget(), announce_player(), announce_trade_route_removal(), api_edit_give_technology(), change_build_target(), check_for_game_over(), city_build_building(), civil_war(), client_diplomacy_clause_string(), create_barbarian_player(), create_command_newcomer(), create_diplomacy_dialog(), dem_line_item(), diplo_wdg::diplo_wdg(), diplomat_bribe_stack(), diplomat_bribe_unit(), diplomat_embassy(), diplomat_sabotage(), do_capture_units(), do_expel_unit(), do_nuclear_explosion(), do_nuke_tile(), do_unit_establish_trade(), do_unit_strike_city_building(), do_unit_strike_city_production(), do_wipe_units(), fit_nationset_to_players(), forget_tech_transferred(), government_change(), handle_diplomacy_accept_treaty_req(), handle_diplomacy_cancel_pact(), handle_player_change_government(), handle_spaceship_launch(), historian_generic(), is_allowed_city_name(), kill_player(), make_contact(), plr_widget::nation_selected(), notify_global_caught(), notify_global_success(), notify_victim_caught(), notify_victim_success(), players_vision_callback(), players_vision_callback(), players_war_callback(), players_war_callback(), qtg_init_meeting(), redraw_unit_info_label(), remove_illegal_armistice_units(), research_pretty_name(), mr_menu::save_image(), sg_load_players(), sg_load_players(), show_new_turn_info(), spy_nuke_city(), spy_sabotage_unit(), spy_spread_plague(), spy_steal_gold(), spy_steal_some_maps(), steal_a_tech(), tech_transfer(), transfer_unit(), update_diplomatics(), update_info_label(), and fc_client::update_sidebar_tooltips().

◆ nation_plural_translation()

const char * nation_plural_translation ( const struct nation_type pnation)

◆ nation_rule_name()

const char * nation_rule_name ( const struct nation_type pnation)

◆ nation_set_by_number()

struct nation_set * nation_set_by_number ( int  id)

Return the nation set with the given index.

This function returns NULL for an out-of-range index (some callers rely on this).

Definition at line 762 of file nation.c.

Referenced by fit_nationset_to_players(), handle_ruleset_nation(), load_ruleset_nations(), nation_set_by_setting_value(), next_set_callback(), and prev_set_callback().

◆ nation_set_by_rule_name()

struct nation_set * nation_set_by_rule_name ( const char name)

Return the nation set that has the given (untranslated) rule name. Returns NULL if no set is found.

Definition at line 779 of file nation.c.

Referenced by load_ruleset_nations(), nation_group_new(), nation_set_by_setting_value(), nation_set_new(), nationset_callback(), nationset_callback(), and races_dialog::nationset_changed().

◆ nation_set_by_setting_value()

struct nation_set * nation_set_by_setting_value ( const char setting)

Returns the nation set that would be selected by the given value of the 'nationset' server setting. This differs from nation_set_by_rule_name() for the empty string, where the first (ruleset default) nationset will be used; and similarly for a nationset not matched in the ruleset. The knowledge of the interpretation of this setting encapsulated here is required on both server and client.

Definition at line 859 of file nation.c.

Referenced by client_current_nation_set(), current_nationset(), nationset_callback(), races_dialog::nationset_changed(), nationset_sync_to_server(), popup_races_dialog(), and races_dialog::update_nationset_combo().

◆ nation_set_count()

int nation_set_count ( void  )

◆ nation_set_description()

const char * nation_set_description ( const struct nation_set pset)

Return the (untranslated) user description of a nation set. You don't have to free the return pointer.

Definition at line 828 of file nation.c.

Referenced by create_races_dialog(), save_nations_ruleset(), send_ruleset_nations(), show_nationsets(), and races_dialog::update_nationset_combo().

◆ nation_set_index()

int nation_set_index ( const struct nation_set pset)

◆ nation_set_iter_init()

struct iterator * nation_set_iter_init ( struct nation_set_iter it)

Implementation of iterator 'init' function.

Definition at line 922 of file nation.c.

◆ nation_set_iter_sizeof()

size_t nation_set_iter_sizeof ( void  )

Implementation of iterator 'sizeof' function.

Definition at line 889 of file nation.c.

◆ nation_set_name_translation()

const char * nation_set_name_translation ( const struct nation_set pset)

Return the translated name of a nation set. You don't have to free the return pointer.

Definition at line 818 of file nation.c.

Referenced by create_races_dialog(), popup_races_dialog(), races_dialog::races_dialog(), and show_nationsets().

◆ nation_set_new()

struct nation_set * nation_set_new ( const char set_name,
const char set_rule_name,
const char set_description 
)

Add new set into the array of nation sets.

Definition at line 716 of file nation.c.

Referenced by handle_ruleset_nation_sets(), and load_ruleset_nations().

◆ nation_set_number()

int nation_set_number ( const struct nation_set pset)

Return the nation set index.

Definition at line 708 of file nation.c.

Referenced by load_ruleset_nations(), and send_ruleset_nations().

◆ nation_set_rule_name()

const char * nation_set_rule_name ( const struct nation_set pset)

Return the (untranslated) rule name of a nation set. You don't have to free the return pointer.

Definition at line 807 of file nation.c.

Referenced by create_races_dialog(), fit_nationset_to_players(), load_ruleset_nations(), next_set_callback(), prev_set_callback(), races_dialog::races_dialog(), save_nation(), save_nations_ruleset(), send_ruleset_nations(), and show_nationsets().

◆ nation_set_untranslated_name()

const char * nation_set_untranslated_name ( const struct nation_set pset)

Return the untranslated name of a nation set (including qualifier, if any). You usually want nation_set_rule_name() instead. You don't have to free the return pointer.

Definition at line 797 of file nation.c.

Referenced by save_nations_ruleset(), and send_ruleset_nations().

◆ nation_sets_groups_free()

void nation_sets_groups_free ( void  )

Frees and resets all nation set/group data.

Definition at line 1178 of file nation.c.

Referenced by game_ruleset_free().

◆ nation_sets_groups_init()

void nation_sets_groups_init ( void  )

Initializes all nation set/group data.

Definition at line 1170 of file nation.c.

Referenced by game_ruleset_init().

◆ nations_alloc()

void nations_alloc ( int  num)

Allocate space for the given number of nations.

Definition at line 622 of file nation.c.

Referenced by handle_ruleset_control(), and load_nation_names().

◆ nations_free()

void nations_free ( void  )

De-allocate the currently allocated nations.

Definition at line 637 of file nation.c.

Referenced by game_ruleset_free().

◆ nations_match()

int nations_match ( const struct nation_type pnation1,
const struct nation_type pnation2,
bool  ignore_conflicts 
)

Returns how much two nations look good in the same game. Nations in the same group are considered to match, if that nation group has a 'match' greater than zero. Negative return value means that we really really don't want these nations together. This is dictated by "conflicts_with" in individual nation definitions. (If 'ignore_conflicts' is set, conflicts are not taken into account at all.) Server side function.

Definition at line 1206 of file nation.c.

Referenced by create_command_newcomer(), and pick_a_nation().

◆ style_of_nation()

struct nation_style * style_of_nation ( const struct nation_type pnation)