The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Types | Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | List of all members
unit_race Class Reference

#include <race.hpp>

Public Types

enum  GENDER { MALE, FEMALE, NUM_GENDERS }
 

Public Member Functions

 unit_race (const config &cfg)
 
const configget_cfg () const
 
const std::stringid () const
 
const t_stringname (GENDER gender=MALE) const
 
const t_stringplural_name () const
 
const t_stringdescription () const
 
std::string generate_name (GENDER gender) const
 
const name_generatorgenerator (GENDER gender) const
 
bool uses_global_traits () const
 
const config::const_child_itorsadditional_traits () const
 
const config::const_child_itorsadditional_topics () const
 
unsigned int num_traits () const
 
const std::stringundead_variation () const
 

Static Public Attributes

static const std::string s_female
 Standard string id (not translatable) for FEMALE. More...
 
static const std::string s_male
 Standard string id (not translatable) for MALE. More...
 
static const unit_race null_race
 Dummy race used when a race is not yet known. More...
 

Private Member Functions

 unit_race ()
 Only used to construct null_race. More...
 

Private Attributes

const config cfg_
 
std::string id_
 
t_string name_ [NUM_GENDERS]
 
t_string plural_name_
 
t_string description_
 
unsigned int ntraits_
 
boost::shared_ptr< name_generatorname_generator_ [NUM_GENDERS]
 
config::const_child_itors traits_
 
config::const_child_itors topics_
 
bool global_traits_
 
std::string undead_variation_
 

Detailed Description

Definition at line 22 of file race.hpp.

Member Enumeration Documentation

Enumerator
MALE 
FEMALE 
NUM_GENDERS 

Definition at line 25 of file race.hpp.

Constructor & Destructor Documentation

unit_race::unit_race ( const config cfg)
explicit
unit_race::unit_race ( )
private

Only used to construct null_race.

Definition at line 48 of file race.cpp.

References FEMALE, MALE, and name_.

Member Function Documentation

const config::const_child_itors & unit_race::additional_topics ( ) const

Definition at line 143 of file race.cpp.

References topics_.

const config::const_child_itors & unit_race::additional_traits ( ) const

Definition at line 138 of file race.cpp.

References traits_.

Referenced by unit_type::build_full(), and impl_race_get().

const t_string& unit_race::description ( ) const
inline

Definition at line 36 of file race.hpp.

References description_.

Referenced by impl_race_get().

std::string unit_race::generate_name ( unit_race::GENDER  gender) const

Definition at line 123 of file race.cpp.

References unit::gender(), and name_generator_.

Referenced by unit::generate_name().

const name_generator & unit_race::generator ( unit_race::GENDER  gender) const

Definition at line 128 of file race.cpp.

References unit::gender(), and name_generator_.

Referenced by impl_race_get().

const config& unit_race::get_cfg ( ) const
inline

Definition at line 32 of file race.hpp.

References cfg_.

Referenced by impl_race_get().

const std::string& unit_race::id ( ) const
inline
const t_string& unit_race::name ( GENDER  gender = MALE) const
inline
unsigned int unit_race::num_traits ( ) const

Definition at line 148 of file race.cpp.

References ntraits_.

Referenced by unit_type::build_help_index(), and impl_race_get().

const t_string& unit_race::plural_name ( ) const
inline

Definition at line 35 of file race.hpp.

References plural_name_.

Referenced by impl_race_get(), and help::unit_topic_generator::operator()().

const std::string& unit_race::undead_variation ( ) const
inline

Definition at line 46 of file race.hpp.

References undead_variation_.

Referenced by unit_type::build_full(), and impl_race_get().

bool unit_race::uses_global_traits ( ) const

Definition at line 133 of file race.cpp.

References global_traits_.

Referenced by unit_type::build_full(), and impl_race_get().

Member Data Documentation

const config unit_race::cfg_
private

Definition at line 55 of file race.hpp.

Referenced by get_cfg().

t_string unit_race::description_
private

Definition at line 60 of file race.hpp.

Referenced by description().

bool unit_race::global_traits_
private

Definition at line 66 of file race.hpp.

Referenced by uses_global_traits().

std::string unit_race::id_
private

Definition at line 57 of file race.hpp.

Referenced by id(), and unit_race().

t_string unit_race::name_[NUM_GENDERS]
private

Definition at line 58 of file race.hpp.

Referenced by name(), and unit_race().

boost::shared_ptr<name_generator> unit_race::name_generator_[NUM_GENDERS]
private

Definition at line 62 of file race.hpp.

Referenced by generate_name(), generator(), and unit_race().

unsigned int unit_race::ntraits_
private

Definition at line 61 of file race.hpp.

Referenced by num_traits().

const unit_race unit_race::null_race
static

Dummy race used when a race is not yet known.

Definition at line 49 of file race.hpp.

Referenced by unit_type::build_full(), unit_type::build_help_index(), and unit::unit().

t_string unit_race::plural_name_
private

Definition at line 59 of file race.hpp.

Referenced by plural_name(), and unit_race().

const std::string unit_race::s_female
static

Standard string id (not translatable) for FEMALE.

Definition at line 26 of file race.hpp.

Referenced by gender_string(), unit_type::get_gender_unit_type(), ng::flg_manager::reset_gender_combo(), string_gender(), and ng::flg_manager::update_available_genders().

const std::string unit_race::s_male
static

Standard string id (not translatable) for MALE.

Definition at line 27 of file race.hpp.

Referenced by gender_string(), unit_type::get_gender_unit_type(), ng::flg_manager::reset_gender_combo(), string_gender(), and ng::flg_manager::update_available_genders().

config::const_child_itors unit_race::topics_
private

Definition at line 65 of file race.hpp.

Referenced by additional_topics().

config::const_child_itors unit_race::traits_
private

Definition at line 64 of file race.hpp.

Referenced by additional_traits().

std::string unit_race::undead_variation_
private

Definition at line 67 of file race.hpp.

Referenced by undead_variation().


The documentation for this class was generated from the following files: