207 return pnation1 == pnation2;
215 const char *ruler_male_title,
216 const char *ruler_female_title)
221 name_set(&pruler_title->
male, domain, ruler_male_title);
243 if (NULL != pruler_title->
pnation) {
244 log_error(
"\"%s\" male ruler title for nation \"%s\" (nb %d) "
245 "is not a format. It should match \"%%s\"",
250 log_error(
"\"%s\" male ruler title is not a format. "
251 "It should match \"%%s\"",
258 if (NULL != pruler_title->
pnation) {
259 log_error(
"\"%s\" female ruler title for nation \"%s\" (nb %d) "
260 "is not a format. It should match \"%%s\"",
265 log_error(
"\"%s\" female ruler title is not a format. "
266 "It should match \"%%s\"",
273 if (NULL != pruler_title->
pnation) {
274 log_error(
"Translation of \"%s\" male ruler title for nation \"%s\" "
275 "(nb %d) is not a format (\"%s\"). It should match \"%%s\"",
281 log_error(
"Translation of \"%s\" male ruler title is not a format "
282 "(\"%s\"). It should match \"%%s\"",
290 if (NULL != pruler_title->
pnation) {
291 log_error(
"Translation of \"%s\" female ruler title for nation \"%s\" "
292 "(nb %d) is not a format (\"%s\"). It should match \"%%s\"",
298 log_error(
"Translation of \"%s\" female ruler title is not a format "
299 "(\"%s\"). It should match \"%%s\"",
312const struct ruler_title_hash *
326 const char *ruler_male_title,
327 const char *ruler_female_title)
329 const char *domain = NULL;
346 log_error(
"Ruler title for government \"%s\" (nb %d) and "
347 "nation \"%s\" (nb %d) was set twice.",
351 log_error(
"Default ruler title for government \"%s\" (nb %d) "
391 char *buf,
size_t buf_len)
405 NULL, &pruler_title)) {
406 log_error(
"Missing title for government \"%s\" (nb %d) "
407 "nation \"%s\" (nb %d).",
414 ? &pruler_title->
male
426 char *buf,
size_t buf_len)
444#define GOVERNMENT_ITER(p) ((struct government_iter *) (p))
476 return it->
p < it->
end;
497 memset(pgovern, 0,
sizeof(*pgovern));
503 requirement_vector_init(&pgovern->
reqs);
522 requirement_vector_free(&pgovern->
reqs);
#define city_owner(_pcity_)
int get_player_bonus(const struct player *pplayer, enum effect_type effect_type)
unsigned int genhash_val_t
const char * government_name_translation(const struct government *pgovern)
const char * default_title_for_player(const struct player *pplayer, char *buf, size_t buf_len)
void governments_free(void)
const struct nation_type * ruler_title_nation(const struct ruler_title *pruler_title)
bool untargeted_revolution_allowed(void)
static void government_init(struct government *pgovern)
struct ruler_title * government_ruler_title_new(struct government *pgovern, const struct nation_type *pnation, const char *ruler_male_title, const char *ruler_female_title)
static void government_iter_next(struct iterator *iter)
const char * ruler_title_for_player(const struct player *pplayer, char *buf, size_t buf_len)
struct iterator * government_iter_init(struct government_iter *it)
const char * ruler_title_female_untranslated_name(const struct ruler_title *pruler_title)
Government_type_id government_count(void)
static struct ruler_title * ruler_title_new(const struct nation_type *pnation, const char *domain, const char *ruler_male_title, const char *ruler_female_title)
static bool government_iter_valid(const struct iterator *iter)
struct government * government_by_number(const Government_type_id gov)
struct government * government_of_player(const struct player *pplayer)
const char * government_name_for_player(const struct player *pplayer)
static bool nation_hash_comp(const struct nation_type *pnation1, const struct nation_type *pnation2)
const char * ruler_title_male_untranslated_name(const struct ruler_title *pruler_title)
static void ruler_title_destroy(struct ruler_title *pruler_title)
static void government_free(struct government *pgovern)
struct government * government_of_city(const struct city *pcity)
struct government * governments
static genhash_val_t nation_hash_val(const struct nation_type *pnation)
void governments_alloc(int num)
bool can_change_to_government(struct player *pplayer, const struct government *gov)
Government_type_id government_number(const struct government *pgovern)
const struct ruler_title_hash * government_ruler_titles(const struct government *pgovern)
Government_type_id government_index(const struct government *pgovern)
size_t government_iter_sizeof(void)
static bool ruler_title_check(const struct ruler_title *pruler_title)
#define GOVERNMENT_ITER(p)
const char * government_rule_name(const struct government *pgovern)
static void * government_iter_get(const struct iterator *iter)
struct government * government_by_translated_name(const char *name)
struct government * government_by_rule_name(const char *name)
#define governments_iterate(NAME_pgov)
#define governments_iterate_end
#define fc_assert(condition)
#define fc_assert_ret_val(condition, val)
#define log_error(message,...)
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)
const char * nation_rule_name(const struct nation_type *pnation)
Nation_type_id nation_count(void)
Nation_type_id nation_number(const struct nation_type *pnation)
struct nation_type * nation_of_player(const struct player *pplayer)
const char * player_name(const struct player *pplayer)
bool are_reqs_active(const struct req_context *context, const struct player *other_player, const struct requirement_vector *reqs, const enum req_problem_type prob_type)
bool formats_match(const char *format1, const char *format2)
void strvec_destroy(struct strvec *psv)
struct packet_ruleset_control control
struct packet_game_info info
struct requirement_vector reqs
Government_type_id item_number
struct name_translation name
struct ruler_title_hash * ruler_titles
bool(* valid)(const struct iterator *it)
void *(* get)(const struct iterator *it)
void(* next)(struct iterator *it)
char * translation_domain
enum revolen_type revolentype
struct government * government
struct name_translation male
struct name_translation female
const struct nation_type * pnation
int fc_snprintf(char *str, size_t n, const char *format,...)
int fc_strcasecmp(const char *str0, const char *str1)