#include <race.hpp>
Public Types | |
enum | GENDER { MALE , FEMALE , NUM_GENDERS } |
Public Member Functions | |
unit_race (const config &cfg) | |
const config & | get_cfg () const |
const std::string & | id () const |
const std::string & | editor_icon () const |
const t_string & | name (GENDER gender=MALE) const |
const t_string & | plural_name () const |
const t_string & | description () const |
std::string | generate_name (GENDER gender) const |
const name_generator & | generator (GENDER gender) const |
bool | uses_global_traits () const |
const config::const_child_itors & | additional_traits () const |
const config::const_child_itors & | additional_topics () const |
unsigned int | num_traits () const |
const std::string & | undead_variation () const |
std::string | get_icon_path_stem () const |
Gets this race's icon path without state/size suffix and extension. More... | |
const std::string & | help_taxonomy () 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_ |
std::string | icon_ |
std::array< t_string, NUM_GENDERS > | name_ |
t_string | plural_name_ |
t_string | description_ |
unsigned int | ntraits_ |
std::array< std::shared_ptr< name_generator >, NUM_GENDERS > | name_generator_ |
config::const_child_itors | traits_ |
config::const_child_itors | topics_ |
bool | global_traits_ |
std::string | undead_variation_ |
std::string | help_taxonomy_ |
enum unit_race::GENDER |
|
explicit |
Definition at line 67 of file race.cpp.
References t_string::empty(), ERR_WML, FEMALE, gender_string(), name_generator_factory::get_name_generator(), i, id_, lg::log_to_chat(), MALE, n, name_, name_generator_, NUM_GENDERS, and plural_name_.
|
private |
Only used to construct null_race.
Definition at line 49 of file race.cpp.
References generator(), and name_generator_.
const config::const_child_itors & unit_race::additional_topics | ( | ) | const |
const config::const_child_itors & unit_race::additional_traits | ( | ) | const |
Definition at line 126 of file race.cpp.
References traits_.
Referenced by unit_type::build_help_index(), and impl_race_get().
|
inline |
|
inline |
std::string unit_race::generate_name | ( | unit_race::GENDER | gender | ) | const |
Definition at line 111 of file race.cpp.
References name_generator_.
Referenced by unit::generate_name().
const name_generator & unit_race::generator | ( | unit_race::GENDER | gender | ) | const |
Definition at line 116 of file race.cpp.
References name_generator_.
Referenced by impl_race_get(), and unit_race().
|
inline |
std::string unit_race::get_icon_path_stem | ( | ) | const |
Gets this race's icon path without state/size suffix and extension.
This doesn't return the full path. Its output looks something like this: icons/unit-groups/race_elf
This is because this output is used in the editor for a GUI1 button's icon, and GUI1 automatically appends the state extension, such as "_30-pressed.png"
If a custom icon has been provided, that is used. Else, it checks if an appropriate icon exists in icons/unit-groups/. If not, a generic custom race icon will be used.
Definition at line 165 of file race.cpp.
References filesystem::get_binary_file_location(), icon_, id_, and game_config::path.
Referenced by gui2::unit_preview_pane::set_displayed_unit().
|
inline |
Definition at line 67 of file race.hpp.
References help_taxonomy_.
|
inline |
Definition at line 36 of file race.hpp.
References id_.
Referenced by unit_filter_impl::unit_filter_compound::fill(), wfl::unit_callable::get_value(), unit_type::hide_help(), impl_race_tostring(), luaW_pushrace(), unit_type_data::set_config(), UNIT_GETTER(), unit_race(), and unit::write().
Definition at line 38 of file race.hpp.
References name_.
Referenced by impl_race_get(), gui2::unit_preview_pane::set_displayed_unit(), and unit_race().
unsigned int unit_race::num_traits | ( | ) | const |
Definition at line 136 of file race.cpp.
References ntraits_.
Referenced by unit_type::build_help_index(), and impl_race_get().
|
inline |
Definition at line 39 of file race.hpp.
References plural_name_.
Referenced by impl_race_get(), and help::unit_topic_generator::operator()().
|
inline |
Definition at line 50 of file race.hpp.
References undead_variation_.
Referenced by unit_type::build_full(), unit_type::build_help_index(), and impl_race_get().
bool unit_race::uses_global_traits | ( | ) | const |
Definition at line 121 of file race.cpp.
References global_traits_.
Referenced by unit_type::build_help_index(), and impl_race_get().
|
private |
|
private |
Definition at line 82 of file race.hpp.
Referenced by description().
|
private |
Definition at line 88 of file race.hpp.
Referenced by uses_global_traits().
|
private |
Definition at line 90 of file race.hpp.
Referenced by help_taxonomy().
|
private |
Definition at line 79 of file race.hpp.
Referenced by editor_icon(), and get_icon_path_stem().
|
private |
Definition at line 78 of file race.hpp.
Referenced by get_icon_path_stem(), id(), and unit_race().
|
private |
Definition at line 80 of file race.hpp.
Referenced by name(), and unit_race().
|
private |
Definition at line 84 of file race.hpp.
Referenced by generate_name(), generator(), and unit_race().
|
private |
Definition at line 83 of file race.hpp.
Referenced by num_traits().
|
static |
Dummy race used when a race is not yet known.
Definition at line 70 of file race.hpp.
Referenced by unit_type::build_full(), unit_type::build_help_index(), and unit::init().
|
private |
Definition at line 81 of file race.hpp.
Referenced by plural_name(), and unit_race().
|
static |
Standard string id (not translatable) for FEMALE.
Definition at line 29 of file race.hpp.
Referenced by gender_string(), unit_type::get_gender_unit_type(), gui2::dialogs::faction_select::pre_show(), string_gender(), and ng::flg_manager::update_available_genders().
|
static |
Standard string id (not translatable) for MALE.
Definition at line 30 of file race.hpp.
Referenced by gender_string(), unit_type::get_gender_unit_type(), gui2::dialogs::faction_select::pre_show(), string_gender(), and ng::flg_manager::update_available_genders().
|
private |
Definition at line 87 of file race.hpp.
Referenced by additional_topics().
|
private |
Definition at line 86 of file race.hpp.
Referenced by additional_traits().
|
private |
Definition at line 89 of file race.hpp.
Referenced by undead_variation().