The Battle for Wesnoth  1.19.0+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 "utils/name_generator.hpp"
#include "utils/name_generator_factory.hpp"
Include dependency graph for race.cpp:

Go to the source code of this file.

Macros

#define ERR_WML   LOG_STREAM(err, log_wml)
 

Functions

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...
 

Variables

static lg::log_domain log_wml ("wml")
 

Detailed Description

Generate race-specific unit-names.

Definition in file race.cpp.

Macro Definition Documentation

◆ ERR_WML

#define ERR_WML   LOG_STREAM(err, log_wml)

Definition at line 29 of file race.cpp.

Function Documentation

◆ empty_topics()

static const config& empty_topics ( )
static

Definition at line 44 of file race.cpp.

◆ empty_traits()

static const config& empty_traits ( )
static

Definition at line 39 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 159 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"  )
static