The Battle for Wesnoth  1.19.7+dev
Classes | Typedefs | Functions
race.hpp File Reference
#include "config.hpp"
#include "global.hpp"
#include "utils/name_generator.hpp"
#include <array>
#include <memory>
Include dependency graph for race.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  unit_race
 

Typedefs

typedef std::map< std::string, unit_racerace_map
 

Functions

unit_race::GENDER string_gender (const std::string &str, unit_race::GENDER def=unit_race::MALE)
 
const std::string & gender_string (unit_race::GENDER gender)
 
NOT_DANGLING 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...
 

Typedef Documentation

◆ race_map

typedef std::map<std::string,unit_race> race_map

Definition at line 105 of file race.hpp.

Function Documentation

◆ gender_string()

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

◆ gender_value()

NOT_DANGLING 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 used to look up a value instead.

Definition at line 158 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 = unit_race::MALE 
)