66 plural_name_(cfg[
"plural_name"].t_str()),
68 ntraits_(cfg[
"num_traits"]),
69 traits_(cfg.child_range(
"trait")),
70 topics_(cfg.child_range(
"topic")),
71 global_traits_(!cfg[
"ignore_global_traits"].to_bool()),
76 lg::wml_error() <<
"[race] '" << cfg[
"name"] <<
"' is missing an id field.";
79 lg::wml_error() <<
"[race] '" << cfg[
"name"] <<
"' is missing a plural_name field.";
94 if(male_generator.
blank()) {
95 male_generator = cfg[
"name_generator"];
97 if(female_generator.
blank()) {
98 female_generator = cfg[
"name_generator"];
101 if(!male_generator.
blank()) {
107 if(!female_generator.
blank()) {
114 int chain_size = cfg[
"markov_chain_size"].to_int(2);
static const config & empty_traits()
static const std::string s_male
Standard string id (not translatable) for MALE.
bool uses_global_traits() const
std::string const & gender_string(unit_race::GENDER gender)
const config::const_child_itors & additional_topics() const
boost::shared_ptr< name_generator > name_generator_[NUM_GENDERS]
t_string name_[NUM_GENDERS]
std::pair< const_child_iterator, const_child_iterator > const_child_itors
Variant for storing WML attributes.
const config::const_child_itors & additional_traits() const
bool blank() const
Tests for an attribute that was never set.
static const std::string s_female
Standard string id (not translatable) for FEMALE.
static const unit_race null_race
Dummy race used when a race is not yet known.
unit_race::GENDER string_gender(const std::string &str, unit_race::GENDER def)
unit_race::GENDER gender() const
config::const_child_itors topics_
std::stringstream & wml_error()
Use this logger to send errors due to deprecated WML.
static const config & empty_topics()
const name_generator & generator(GENDER gender) const
std::string generate_name(GENDER gender) const
unit_race()
Only used to construct null_race.
Standard logging facilities (interface).
config::const_child_itors traits_
std::vector< std::string > split(std::string const &val, const char c, const int flags)
Splits a (comma-)separated string into a vector of pieces.
unsigned int num_traits() const
A config object defines a single node in a WML file, with access to child nodes.
GLsizei const GLcharARB ** string
std::string undead_variation_