57#define NATION_CHECK(pnation, action) \
58 fc_assert_action(nation_check(pnation, \
59 log_do_output_for_level(LOG_ERROR), \
60 __FILE__, __FUNCTION__, __FC_LINE__), \
74 "Function called before nations setup.");
78 if (
NULL == pnation) {
81 "This function has NULL nation argument.");
90 "This function has bad nation number %d (count %d).",
99#define NATION_CHECK(pnation, action)
382 log_error(
"%s(): Wrong nation_city_preference variant (%d).",
391 const struct terrain *pterrain,
423 const struct terrain *pterrain)
519#define NATION_ITER(p) ((struct nation_iter *)(p))
551 return it->
p < it->
end;
576 memset(pnation, 0,
sizeof(*pnation));
616 memset(pnation, 0,
sizeof(*pnation));
629 for (
i = 0;
i < num;
i++) {
675 return pnation->
style;
723 log_error(
"More nation sets than reported (%d).",
729 log_error(
"Too many nation sets (%d is the maximum).",
738 "Nation set description \"%s\" too long; truncating.");
746 log_error(
"Nation set name %s is already used for a group.",
831 return pset->description;
884#define NATION_SET_ITER(p) ((struct nation_set_iter *)(p))
916 return it->
p < it->
end;
965 log_error(
"More nation groups than reported (%d).",
971 log_error(
"Too many nation groups (%d is the maximum).",
985 log_error(
"Nation group name %s is already used for a set.",
1119#define NATION_GROUP_ITER(p) ((struct nation_group_iter *)(p))
1151 return it->
p < it->
end;
1188 const struct player *pplayer)
1192 && ((!
pconn->observer &&
pconn->playing == pplayer)
1239 sum +=
pgroup->server.match;
#define city_owner(_pcity_)
bool can_conn_edit(const struct connection *pconn)
struct unit struct city struct unit struct tile struct extra_type const struct act_prob *act_probs int actor_unit_id struct unit struct unit * punit
static bool is_server(void)
#define MAX_NUM_NATION_SETS
#define MAX_NUM_NATION_GROUPS
#define DG_(domain, String)
void do_log(const char *file, const char *function, int line, bool print_from_where, enum log_level level, const char *message,...)
#define fc_assert_ret(condition)
#define fc_assert(condition)
#define fc_assert_ret_val(condition, val)
#define log_error(message,...)
#define fc_calloc(n, esz)
static void name_set(struct name_translation *ptrans, const char *domain, const char *vernacular_name)
static const char * rule_name_get(const struct name_translation *ptrans)
static const char * name_translation_get(const struct name_translation *ptrans)
static const char * untranslated_name(const struct name_translation *ptrans)
static void names_set(struct name_translation *ptrans, const char *domain, const char *vernacular_name, const char *rule_name)
void nation_group_set_match(struct nation_group *pgroup, int match)
const char * nation_city_name(const struct nation_city *pncity)
static void nation_city_destroy(struct nation_city *pncity)
const char * nation_group_untranslated_name(const struct nation_group *pgroup)
const struct nation_city_list * nation_cities(const struct nation_type *pnation)
struct nation_group * nation_group_by_rule_name(const char *name)
struct nation_type * nation_by_translated_plural(const char *name)
const char * nation_rule_name(const struct nation_type *pnation)
enum nation_city_preference nation_city_preference_revert(enum nation_city_preference prefer)
int nation_group_index(const struct nation_group *pgroup)
static void nation_free(struct nation_type *pnation)
Nation_type_id nation_count(void)
static void * nation_iter_get(const struct iterator *iter)
Nation_type_id nation_number(const struct nation_type *pnation)
struct nation_group * nation_group_new(const char *name)
struct nation_leader * nation_leader_by_name(const struct nation_type *pnation, const char *name)
struct iterator * nation_set_iter_init(struct nation_set_iter *it)
int nations_match(const struct nation_type *pnation1, const struct nation_type *pnation2, bool ignore_conflicts)
static bool nation_iter_valid(const struct iterator *iter)
struct nation_type * nation_of_unit(const struct unit *punit)
bool nation_leader_is_male(const struct nation_leader *pleader)
const char * nation_adjective_for_player(const struct player *pplayer)
size_t nation_set_iter_sizeof(void)
static void nation_iter_next(struct iterator *iter)
struct nation_set * nation_set_new(const char *set_name, const char *set_rule_name, const char *set_description)
const char * nation_adjective_translation(const struct nation_type *pnation)
static struct nation_set nation_sets[MAX_NUM_NATION_SETS]
struct nation_type * nation_by_number(const Nation_type_id nation)
int nation_set_index(const struct nation_set *pset)
struct nation_city * nation_city_new(struct nation_type *pnation, const char *name)
enum nation_city_preference nation_city_terrain_preference(const struct nation_city *pncity, const struct terrain *pterrain)
bool is_nation_pickable(const struct nation_type *nation)
const struct nation_leader_list * nation_leaders(const struct nation_type *pnation)
const char * nation_set_name_translation(const struct nation_set *pset)
const char * nation_group_rule_name(const struct nation_group *pgroup)
struct nation_type * nation_of_player(const struct player *pplayer)
const char * nation_set_untranslated_name(const struct nation_set *pset)
struct nation_type * nation_of_city(const struct city *pcity)
static void nation_group_iter_next(struct iterator *iter)
bool is_nation_playable(const struct nation_type *nation)
static struct nation_group nation_groups[MAX_NUM_NATION_GROUPS]
struct iterator * nation_iter_init(struct nation_iter *it)
void nation_sets_groups_free(void)
int nation_set_number(const struct nation_set *pset)
const struct rgbcolor * nation_color(const struct nation_type *pnation)
void nation_city_set_terrain_preference(struct nation_city *pncity, const struct terrain *pterrain, enum nation_city_preference prefer)
#define NATION_SET_ITER(p)
static int num_nation_sets
struct iterator * nation_group_iter_init(struct nation_group_iter *it)
void nation_city_set_river_preference(struct nation_city *pncity, enum nation_city_preference prefer)
bool nation_is_in_group(const struct nation_type *pnation, const struct nation_group *pgroup)
static void * nation_set_iter_get(const struct iterator *iter)
bool nation_is_in_set(const struct nation_type *pnation, const struct nation_set *pset)
const char * nation_set_description(const struct nation_set *pset)
const char * nation_group_name_translation(const struct nation_group *pgroup)
enum nation_city_preference nation_city_river_preference(const struct nation_city *pncity)
int nation_set_count(void)
static int num_nation_groups
void nation_sets_groups_init(void)
struct nation_set * nation_set_by_number(int id)
struct nation_type * nation_by_rule_name(const char *name)
struct nation_group * nation_group_by_number(int id)
static void nation_leader_destroy(struct nation_leader *pleader)
#define NATION_GROUP_ITER(p)
static void nation_set_iter_next(struct iterator *iter)
static bool nation_set_iter_valid(const struct iterator *iter)
const char * nation_plural_translation(const struct nation_type *pnation)
struct nation_set * nation_set_by_rule_name(const char *name)
bool is_nation_group_hidden(struct nation_group *pgroup)
static struct nation_type * nations
bool can_conn_edit_players_nation(const struct connection *pconn, const struct player *pplayer)
struct nation_set * nation_set_by_setting_value(const char *setting)
Nation_type_id nation_index(const struct nation_type *pnation)
const char * nation_leader_name(const struct nation_leader *pleader)
static bool nation_group_iter_valid(const struct iterator *iter)
static void * nation_group_iter_get(const struct iterator *iter)
int nation_group_count(void)
const char * nation_set_rule_name(const struct nation_set *pset)
struct nation_leader * nation_leader_new(struct nation_type *pnation, const char *name, bool is_male)
#define NATION_CHECK(pnation, action)
void nation_group_set_hidden(struct nation_group *pgroup, bool hidden)
static void nation_init(struct nation_type *pnation)
void nations_alloc(int num)
enum barbarian_type nation_barbarian_type(const struct nation_type *nation)
const char * nation_plural_for_player(const struct player *pplayer)
size_t nation_iter_sizeof(void)
int nation_group_number(const struct nation_group *pgroup)
size_t nation_group_iter_sizeof(void)
struct government * init_government_of_nation(const struct nation_type *pnation)
struct nation_style * style_of_nation(const struct nation_type *pnation)
const char * nation_legend_translation(const struct nation_type *pnation, const char *legend)
#define nation_leader_list_iterate(leaderlist, pleader)
#define nation_list_iterate(nationlist, pnation)
#define nation_sets_iterate_end
#define nation_set_list_iterate_end
#define nation_group_list_iterate(grouplist, pgroup)
#define nation_sets_iterate(NAME_pset)
#define nations_iterate_end
#define nation_list_iterate_end
#define nations_iterate(NAME_pnation)
#define nation_leader_list_iterate_end
#define nation_group_list_iterate_end
#define nation_set_list_iterate(setlist, pset)
#define nation_groups_iterate(NAME_pgroup)
#define nation_groups_iterate_end
#define NO_NATION_SELECTED
void rgbcolor_destroy(struct rgbcolor *prgbcolor)
#define sz_loud_strlcpy(buffer, str, errmsg)
struct packet_ruleset_control control
struct packet_game_info info
struct government * default_government
bool(* valid)(const struct iterator *it)
void *(* get)(const struct iterator *it)
void(* next)(struct iterator *it)
enum nation_city_preference river
struct nation_group * end
struct name_translation name
char description[MAX_LEN_MSG]
struct nation_list * conflicts_with
struct nation_group_list * groups
struct name_translation noun_plural
struct nation_list * parent_nations
struct nation_set_list * sets
struct name_translation adjective
struct trait_limits * traits
struct government * init_government
struct nation_leader_list * leaders
Nation_type_id item_number
enum barbarian_type barb_type
struct nation_type::@51::@54 client
char * translation_domain
struct nation_style * style
struct nation_type::@51::@53 server
struct nation_city_list * default_cities
struct nation_list * civilwar_nations
struct nation_type * nation
int fc_strcasecmp(const char *str0, const char *str1)
Terrain_type_id terrain_index(const struct terrain *pterrain)