The Battle for Wesnoth  1.17.17+dev
Macros | Functions | Variables
race.cpp File Reference

Generate race-specific unit-names. More...

#include "units/race.hpp"
#include "filesystem.hpp"
#include "log.hpp"
#include "serialization/string_utils.hpp"
#include "serialization/unicode_cast.hpp"
#include "utils/name_generator.hpp"
#include "utils/name_generator_factory.hpp"
Include dependency graph for race.cpp:

Go to the source code of this file.


#define ERR_WML   LOG_STREAM(err, log_wml)


static const configempty_traits ()
static const configempty_topics ()
const std::string & gender_string (unit_race::GENDER gender)
unit_race::GENDER string_gender (const std::string &str, unit_race::GENDER def)
const config::attribute_valuegender_value (const config &cfg, unit_race::GENDER gender, const std::string &male_key, const std::string &female_key, const std::string &default_key)
 Chooses a value from the given config based on gender. More...


static lg::log_domain log_wml ("wml")

Detailed Description

Generate race-specific unit-names.

Definition in file race.cpp.

Macro Definition Documentation


#define ERR_WML   LOG_STREAM(err, log_wml)

Definition at line 31 of file race.cpp.

Function Documentation

◆ empty_topics()

static const config& empty_topics ( )

Definition at line 46 of file race.cpp.

◆ empty_traits()

static const config& empty_traits ( )

Definition at line 41 of file race.cpp.

◆ gender_string()

const std::string& gender_string ( unit_race::GENDER  gender)

◆ gender_value()

const config::attribute_value& gender_value ( const config cfg,
unit_race::GENDER  gender,
const std::string &  male_key,
const std::string &  female_key,
const std::string &  default_key 

Chooses a value from the given config based on gender.

If the value for the specified gender is blank, then default_key is chosen instead.

Definition at line 161 of file race.cpp.

References config::get_or(), and unit_race::MALE.

Referenced by unit::init().

◆ string_gender()

unit_race::GENDER string_gender ( const std::string &  str,
unit_race::GENDER  def 

Variable Documentation

◆ log_wml

lg::log_domain log_wml("wml") ( "wml"  )