The Battle for Wesnoth  1.15.5+dev
types.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2003 - 2018 by David White <dave@whitevine.net>
3  Part of the Battle for Wesnoth Project https://www.wesnoth.org/
4 
5  This program is free software; you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation; either version 2 of the License, or
8  (at your option) any later version.
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY.
11 
12  See the COPYING file for more details.
13 */
14 
15 #pragma once
16 
17 #include "gettext.hpp"
18 #include "utils/make_enum.hpp"
19 #include "map/location.hpp"
20 #include "movetype.hpp"
21 #include "units/race.hpp"
22 #include "units/attack_type.hpp"
23 #include "units/alignment.hpp"
24 #include "units/type_error.hpp"
25 #include "game_config_view.hpp"
26 #include <memory>
27 #include <array>
28 #include <map>
29 #include <set>
30 #include <string>
31 #include <vector>
32 
33 class unit_ability_list;
34 class unit_animation;
36 
37 typedef std::map<std::string, movetype> movement_type_map;
38 
39 
40 /**
41  * A single unit type that the player may recruit.
42  * Individual units are defined by the unit class.
43  */
44 class unit_type
45 {
46 private:
47  struct defaut_ctor_t {};
48  unit_type(defaut_ctor_t, const config& cfg, const std::string & parent_id);
49 
50 public:
52  /**
53  * Creates a unit type for the given config, but delays its build
54  * till later.
55  * @note @a cfg is not copied, so it has to point to some permanent
56  * storage, that is, a child of unit_type_data::unit_cfg.
57  */
58  explicit unit_type(const config &cfg, const std::string & parent_id="");
59  /**
60  * Creates a unit type for the given config, but delays its build
61  * till later.
62  * @note @a cfg is copied
63  */
64  explicit unit_type(config && cfg, const std::string & parent_id="");
65  unit_type();
66  unit_type(const unit_type& o);
67  unit_type(unit_type&& o) = default;
68 
69  ~unit_type();
70 
71  /// Records the status of the lazy building of unit types.
72  /// These are in order of increasing levels of being built.
73  /// HELP_INDEX is already defined in a windows header under some conditions.
75 
76  /**
77  * Validate the id argument.
78  * Replaces invalid characters in the reference with underscores.
79  * @param id The proposed id for a unit_type.
80  * @throw error if id starts with a space.
81  */
82  static void check_id(std::string& id);
83 
84 private: // These will be called by build().
85  /// Load data into an empty unit_type (build to FULL).
86  void build_full(const movement_type_map &movement_types,
87  const race_map &races, const config_array_view &traits);
88  /// Partially load data into an empty unit_type (build to HELP_INDEXED).
89  void build_help_index(const movement_type_map &movement_types,
90  const race_map &races, const config_array_view &traits);
91  /// Load the most needed data into an empty unit_type (build to CREATE).
92  void build_created();
93 
94  typedef std::map<std::string,unit_type> variations_map;
95 public:
96  /// Performs a build of this to the indicated stage.
97  void build(BUILD_STATUS status, const movement_type_map &movement_types,
98  const race_map &races, const config_array_view &traits);
99  /// Performs a build of this to the indicated stage.
100  /// (This does not logically change the unit type, so allow const access.)
101  void build(BUILD_STATUS status, const movement_type_map &movement_types,
102  const race_map &races, const config_array_view &traits) const
103  { const_cast<unit_type *>(this)->build(status, movement_types, races, traits); }
104 
105 
106  /** Get the advancement tree
107  * @return A set of ids of all unit_type objects that this unit_type can
108  * directly or indirectly advance to.
109  */
110  std::set<std::string> advancement_tree() const;
111 
112  /// A vector of unit_type ids that this unit_type can advance to.
113  const std::vector<std::string>& advances_to() const { return advances_to_; }
114  /// A vector of unit_type ids that can advance to this unit_type.
115  const std::vector<std::string> advances_from() const;
116 
117  /// Returns two iterators pointing to a range of AMLA configs.
119  { return get_cfg().child_range("advancement"); }
120 
121  /**
122  * Returns a gendered variant of this unit_type.
123  * @param gender "male" or "female".
124  */
125  const unit_type& get_gender_unit_type(std::string gender) const;
126  /// Returns a gendered variant of this unit_type based on the given parameter.
127  const unit_type& get_gender_unit_type(unit_race::GENDER gender) const;
128 
129  const unit_type& get_variation(const std::string& id) const;
130  /** Info on the type of unit that the unit reanimates as. */
131  const std::string& undead_variation() const { return undead_variation_; }
132 
133  unsigned int num_traits() const { return num_traits_; }
134 
135  /** The name of the unit in the current language setting. */
136  const t_string& type_name() const { return type_name_; }
137 
138  /// The id for this unit_type.
139  const std::string& id() const { return id_; }
140  /// A variant on id() that is more descriptive, for use with message logging.
141  const std::string log_id() const { return id_ + debug_id_; }
142  /// The id of the original type from which this (variation) descended.
143  const std::string& parent_id() const { return parent_id_; }
144  /// The id of this variation; empty if it's a gender variation or a base unit.
145  const std::string& variation_id() const { return variation_id_; }
146  // NOTE: this used to be a const object reference, but it messed up with the
147  // translation engine upon changing the language in the same session.
148  t_string unit_description() const;
149  bool has_special_notes() const;
150  const std::vector<t_string>& special_notes() const;
151  int hitpoints() const { return hitpoints_; }
152  double hp_bar_scaling() const { return hp_bar_scaling_; }
153  double xp_bar_scaling() const { return xp_bar_scaling_; }
154  int level() const { return level_; }
155  int recall_cost() const { return recall_cost_;}
156  int movement() const { return movement_; }
157  int vision() const { return vision_ < 0 ? movement() : vision_; }
158  /// If @a base_value is set to true, do not fall back to movement().
159  int vision(bool base_value) const { return base_value ? vision_ : vision(); }
160  int jamming() const {return jamming_; }
161  int max_attacks() const { return max_attacks_; }
162  int cost() const { return cost_; }
164  const t_string& variation_name() const { return variation_name_; }
165  const std::string& usage() const { return usage_; }
166  const std::string& image() const { return image_; }
167  const std::string& icon() const { return icon_; }
168  const std::string &small_profile() const { return small_profile_; }
169  const std::string &big_profile() const { return profile_; }
170  std::string halo() const { return get_cfg()["halo"]; }
171  std::string ellipse() const { return get_cfg()["ellipse"]; }
172  bool generate_name() const { return get_cfg()["generate_name"].to_bool(true); }
173  const std::vector<unit_animation>& animations() const;
174 
175  const std::string& flag_rgb() const;
176 
177  const_attack_itors attacks() const;
178  const movetype & movement_type() const { return movement_type_; }
179 
180  int experience_needed(bool with_acceleration=true) const;
181 
182  using ALIGNMENT = UNIT_ALIGNMENT;
183 
184  ALIGNMENT alignment() const { return alignment_; }
186 
188  {
189  explicit ability_metadata(const config& cfg);
190 
192 
195 
198 
201 
206  };
207 
208  const std::vector<ability_metadata>& abilities_metadata() const { return abilities_; }
209 
210  /** Some extra abilities that may be gained through AMLA advancements. */
211  const std::vector<ability_metadata>& adv_abilities_metadata() const { return adv_abilities_; }
212 
213  bool can_advance() const { return !advances_to_.empty(); }
214 
215  bool musthave_status(const std::string& status) const;
216 
217  bool has_zoc() const { return zoc_; }
218 
219  bool has_ability_by_id(const std::string& ability) const;
220  std::vector<std::string> get_ability_list() const;
221 
223  { return possible_traits_.child_range("trait"); }
224 
225  const config& abilities_cfg() const
226  { return get_cfg().child_or_empty("abilities"); }
227 
229  { return get_cfg().child_range("advancement"); }
230 
232  { return get_cfg().child_range("event"); }
233 
234  bool has_random_traits() const;
235 
236  /// The returned vector will not be empty, provided this has been built
237  /// to the HELP_INDEXED status.
238  const std::vector<unit_race::GENDER>& genders() const { return genders_; }
239  bool has_gender_variation(const unit_race::GENDER gender) const
240  {
241  return std::find(genders_.begin(), genders_.end(), gender) != genders_.end();
242  }
243 
244  std::vector<std::string> variations() const;
245  const variations_map& variation_types() const {return variations_; }
246 
247  /**
248  * @param variation_id The id of the variation we search for.
249  * @return Whether one of the type's variations' (or the
250  * siblings' if the unit_type is a variation
251  * itself) id matches @a variation_id.
252  */
253  bool has_variation(const std::string& variation_id) const;
254 
255  /**
256  * Whether the unit type has at least one help-visible variation.
257  */
258  bool show_variations_in_help() const;
259 
260  /// Returns the ID of this type's race without the need to build the type.
261  std::string race_id() const { return get_cfg()["race"]; } //race_->id(); }
262  /// Never returns nullptr, but may point to the null race.
263  /// Requires building to the HELP_INDEXED status to get the correct race.
264  const unit_race* race() const { return race_; }
265  bool hide_help() const;
266  bool do_not_list() const { return do_not_list_; }
267 
268  const config &get_cfg() const
269  {
270  if(built_cfg_) {
271  return *built_cfg_;
272  }
273  assert(cfg_);
274  return *cfg_;
275  }
276 
277  /// Gets resistance while considering custom WML abilities.
278  /// Attention: Filters in resistance-abilities will be ignored.
279  int resistance_against(const std::string& damage_name, bool attacker) const;
280 
281  void apply_scenario_fix(const config& cfg);
282  void remove_scenario_fixes();
283 private:
284 
285  /// Identical to unit::resistance_filter_matches.
286  bool resistance_filter_matches(const config& cfg,bool attacker,const std::string& damage_name, int res) const;
287 
288 private:
290  if(!built_cfg_) {
291  built_cfg_ = std::make_unique<config>(*cfg_);
292  }
293  return *built_cfg_;
294  }
295  void fill_variations();
297  std::unique_ptr<unit_type> create_sub_type(const config& var_cfg, bool default_inherit);
298 
299  void operator=(const unit_type& o);
300 
301  const config* cfg_;
302  friend class unit_type_data;
303  mutable std::unique_ptr<config> built_cfg_;
304  mutable bool has_cfg_build_;
306 
308  std::string debug_id_; /// A suffix for id_, used when logging messages.
309  std::string parent_id_; /// The id of the top ancestor of this unit_type.
310  /// from [base_unit]
314  std::vector<t_string> special_notes_;
317  int level_;
320  int vision_;
321  int jamming_;
323  int cost_;
326 
332 
333  unsigned int num_traits_;
334 
335  std::array<std::unique_ptr<unit_type>, 2> gender_types_;
336 
337  variations_map variations_;
341 
342  const unit_race* race_; /// Never nullptr, but may point to the null race.
343 
344  std::vector<ability_metadata> abilities_, adv_abilities_;
345 
347 
348  std::vector<std::string> advances_to_;
350 
351 
353 
355 
357 
358  std::vector<unit_race::GENDER> genders_;
359 
360  // animations are loaded only after the first animations() call
361  mutable std::vector<unit_animation> animations_;
362 
364 };
365 
367 {
368 public:
369  unit_type_data(const unit_type_data&) = delete;
370  unit_type_data& operator=(const unit_type_data&) = delete;
371 
372  unit_type_data();
373 
374  typedef std::map<std::string,unit_type> unit_type_map;
375 
376  const unit_type_map &types() const { return types_; }
377  const race_map &races() const { return races_; }
378  config_array_view traits() const { return units_cfg().child_range("trait"); }
379  void set_config(const game_config_view &cfg);
380 
381  /// Finds a unit_type by its id() and makes sure it is built to the specified level.
382  const unit_type *find(const std::string &key, unit_type::BUILD_STATUS status = unit_type::FULL) const;
383  void check_types(const std::vector<std::string>& types) const;
384  const unit_race *find_race(const std::string &) const;
385 
386  /// Makes sure the all unit_types are built to the specified level.
387  void build_all(unit_type::BUILD_STATUS status);
388  /// Makes sure the provided unit_type is built to the specified level.
389  void build_unit_type(const unit_type & ut, unit_type::BUILD_STATUS status) const;
390 
391  /** Checks if the [hide_help] tag contains these IDs. */
392  bool hide_help(const std::string &type_id, const std::string &race_id) const;
393 
394  void apply_scenario_fix(const config& cfg);
395  void remove_scenario_fixes();
396 private:
397  /** Parses the [hide_help] tag. */
398  void read_hide_help(const config &cfg);
399 
400  void clear();
401 
402  void apply_base_unit(unit_type& type, std::vector<std::string>& base_tree);
403 
404  mutable unit_type_map types_;
407 
408  /** True if [hide_help] contains a 'all=yes' at its root. */
410  // vectors containing the [hide_help] and its sub-tags [not]
411  std::vector< std::set<std::string>> hide_help_type_;
412  std::vector< std::set<std::string>> hide_help_race_;
413 
414  const game_config_view& units_cfg() const { return units_cfg_; }
417 };
418 
420 
421 void adjust_profile(std::string& profile);
422 
424  unit_experience_accelerator(int modifier);
426  static int get_acceleration();
427 private:
429 };
int jamming_
Definition: types.hpp:321
std::vector< attack_ptr > attack_list
std::string parent_id_
A suffix for id_, used when logging messages.
Definition: types.hpp:309
int experience_needed_
Definition: types.hpp:349
const std::string & parent_id() const
The id of the original type from which this (variation) descended.
Definition: types.hpp:143
UNIT_ALIGNMENT ALIGNMENT
Definition: types.hpp:182
bool has_cfg_build_
Definition: types.hpp:304
bool do_not_list_
Definition: types.hpp:346
unit_type::BUILD_STATUS build_status_
Definition: types.hpp:416
std::map< std::string, unit_type > unit_type_map
Definition: types.hpp:374
std::map< std::string, movetype > movement_type_map
Definition: types.hpp:35
int vision(bool base_value) const
If base_value is set to true, do not fall back to movement().
Definition: types.hpp:159
std::string default_variation_
Definition: types.hpp:338
std::string flag_rgb_
Definition: types.hpp:331
bool generate_name() const
Definition: types.hpp:172
ALIGNMENT alignment_
Definition: types.hpp:352
t_string variation_name_
Definition: types.hpp:340
std::string profile_
Definition: types.hpp:330
config_array_view traits() const
Definition: types.hpp:378
void build(BUILD_STATUS status, const movement_type_map &movement_types, const race_map &races, const config_array_view &traits)
Performs a build of this to the indicated stage.
Definition: types.cpp:419
config::const_child_itors events() const
Definition: types.hpp:231
const std::vector< t_string > & special_notes() const
Definition: types.cpp:499
const std::string & big_profile() const
Definition: types.hpp:169
std::string debug_id_
Definition: types.hpp:308
int hitpoints_
Definition: types.hpp:315
const std::vector< std::string > & advances_to() const
A vector of unit_type ids that this unit_type can advance to.
Definition: types.hpp:113
int recall_cost_
Definition: types.hpp:318
std::string variation_id_
Definition: types.hpp:339
const std::string & flag_rgb() const
Definition: types.cpp:689
~unit_type()
Definition: types.cpp:170
child_itors child_range(config_key_type key)
Definition: config.cpp:362
bool has_special_notes() const
Definition: types.cpp:494
const config * cfg_
Definition: types.hpp:301
void clear(const std::string &key)
Definition: general.cpp:206
t_string description_
Definition: types.hpp:313
void fill_variations()
Processes [variation] tags of ut_cfg, handling inheritance and child clearing.
Definition: types.cpp:967
int experience_needed(bool with_acceleration=true) const
Definition: types.cpp:546
config possible_traits_
Definition: types.hpp:356
void adjust_profile(std::string &profile)
Definition: types.cpp:1380
std::array< std::unique_ptr< unit_type >, 2 > gender_types_
Definition: types.hpp:335
void build_help_index(const movement_type_map &movement_types, const race_map &races, const config_array_view &traits)
Partially load data into an empty unit_type (build to HELP_INDEXED).
Definition: types.cpp:235
int resistance_against(const std::string &damage_name, bool attacker) const
Gets resistance while considering custom WML abilities.
Definition: types.cpp:742
const config & get_cfg() const
Definition: types.hpp:268
BUILD_STATUS
Records the status of the lazy building of unit types.
Definition: types.hpp:74
std::set< std::string > advancement_tree() const
Get the advancement tree.
Definition: types.cpp:614
const std::string & variation_id() const
The id of this variation; empty if it&#39;s a gender variation or a base unit.
Definition: types.hpp:145
t_string type_name_
Definition: types.hpp:312
variations_map variations_
Definition: types.hpp:337
const race_map & races() const
Definition: types.hpp:377
The basic "size" of the unit - flying, small land, large land, etc.
Definition: movetype.hpp:41
void operator=(const unit_type &o)
void build(BUILD_STATUS status, const movement_type_map &movement_types, const race_map &races, const config_array_view &traits) const
Performs a build of this to the indicated stage.
Definition: types.hpp:101
const unit_type_map & types() const
Definition: types.hpp:376
bool do_not_list() const
Definition: types.hpp:266
const std::vector< std::string > advances_from() const
A vector of unit_type ids that can advance to this unit_type.
Definition: types.cpp:621
int level_
Definition: types.hpp:317
A single unit type that the player may recruit.
Definition: types.hpp:44
const unit_race * race_
Definition: types.hpp:342
config & writable_cfg()
Definition: types.hpp:289
void build_full(const movement_type_map &movement_types, const race_map &races, const config_array_view &traits)
Load data into an empty unit_type (build to FULL).
Definition: types.cpp:192
std::string icon_
Definition: types.hpp:328
bool musthave_status(const std::string &status) const
Definition: types.cpp:641
const std::vector< unit_race::GENDER > & genders() const
The returned vector will not be empty, provided this has been built to the HELP_INDEXED status...
Definition: types.hpp:238
int cost() const
Definition: types.hpp:162
void fill_variations_and_gender()
Definition: types.cpp:995
movement_type_map movement_types_
Definition: types.hpp:405
int vision() const
Definition: types.hpp:157
bool zoc_
Definition: types.hpp:346
bool hide_help() const
Definition: types.cpp:593
const movetype & movement_type() const
Definition: types.hpp:178
const std::vector< unit_animation > & animations() const
Definition: types.cpp:503
const t_string & type_name() const
The name of the unit in the current language setting.
Definition: types.hpp:136
std::vector< std::set< std::string > > hide_help_type_
Definition: types.hpp:411
std::vector< std::set< std::string > > hide_help_race_
Definition: types.hpp:412
const std::string & usage() const
Definition: types.hpp:165
std::vector< unit_animation > animations_
Definition: types.hpp:361
std::string small_profile_
Definition: types.hpp:329
std::string ellipse() const
Definition: types.hpp:171
std::unique_ptr< config > built_cfg_
Definition: types.hpp:303
std::string undead_variation_
Definition: types.hpp:325
void remove_scenario_fixes()
Definition: types.cpp:1323
int movement_
Definition: types.hpp:319
movetype movement_type_
Definition: types.hpp:354
const std::vector< ability_metadata > & abilities_metadata() const
Definition: types.hpp:208
std::string race_id() const
Returns the ID of this type&#39;s race without the need to build the type.
Definition: types.hpp:261
const std::string & id() const
The id for this unit_type.
Definition: types.hpp:139
double xp_bar_scaling_
Definition: types.hpp:316
double xp_bar_scaling() const
Definition: types.hpp:153
boost::iterator_range< const_child_iterator > const_child_itors
Definition: config.hpp:210
int cost_
Definition: types.hpp:323
const std::string & undead_variation() const
Info on the type of unit that the unit reanimates as.
Definition: types.hpp:131
const std::string log_id() const
A variant on id() that is more descriptive, for use with message logging.
Definition: types.hpp:141
const game_config_view & units_cfg() const
Definition: types.hpp:414
config::const_child_itors modification_advancements() const
Returns two iterators pointing to a range of AMLA configs.
Definition: types.hpp:118
std::vector< t_string > special_notes_
Definition: types.hpp:314
bool has_zoc() const
Definition: types.hpp:217
unsigned int num_traits_
Definition: types.hpp:333
int recall_cost() const
Definition: types.hpp:155
game_config_view units_cfg_
Definition: types.hpp:415
std::vector< std::string > variations() const
Definition: types.cpp:714
unit_type_map types_
Definition: types.hpp:404
std::vector< std::string > get_ability_list() const
Definition: types.cpp:573
friend class unit_type_data
Definition: types.hpp:302
void apply_scenario_fix(const config &cfg)
Definition: types.cpp:1271
bool show_variations_in_help() const
Whether the unit type has at least one help-visible variation.
Definition: types.cpp:731
const config & abilities_cfg() const
Definition: types.hpp:225
std::vector< std::string > advances_to_
Definition: types.hpp:348
std::string usage_
Definition: types.hpp:324
std::string halo() const
Definition: types.hpp:170
bool has_ability_by_id(const std::string &ability) const
Definition: types.cpp:560
double hp_bar_scaling_
Definition: types.hpp:316
const std::string & icon() const
Definition: types.hpp:167
bool hide_help_all_
True if [hide_help] contains a &#39;all=yes&#39; at its root.
Definition: types.hpp:409
int level() const
Definition: types.hpp:154
std::string base_unit_id_
The id of the top ancestor of this unit_type.
Definition: types.hpp:311
bool has_gender_variation(const unit_race::GENDER gender) const
Definition: types.hpp:239
const std::string & small_profile() const
Definition: types.hpp:168
int hitpoints() const
Definition: types.hpp:151
int jamming() const
Definition: types.hpp:160
const std::vector< ability_metadata > & adv_abilities_metadata() const
Some extra abilities that may be gained through AMLA advancements.
Definition: types.hpp:211
int movement() const
Definition: types.hpp:156
std::string id_
Definition: types.hpp:307
unit_type_data unit_types
Definition: types.cpp:1378
config::const_child_itors possible_traits() const
Definition: types.hpp:222
const std::string & image() const
Definition: types.hpp:166
std::vector< ability_metadata > abilities_
Never nullptr, but may point to the null race.
Definition: types.hpp:344
bool resistance_filter_matches(const config &cfg, bool attacker, const std::string &damage_name, int res) const
Identical to unit::resistance_filter_matches.
Definition: types.cpp:773
int vision_
Definition: types.hpp:320
unsigned int num_traits() const
Definition: types.hpp:133
BUILD_STATUS build_status_
Definition: types.hpp:363
const unit_type & get_variation(const std::string &id) const
Definition: types.cpp:475
std::vector< std::reference_wrapper< const config > > config_array_view
int max_attacks_
Definition: types.hpp:322
bool find(E event, F functor)
Tests whether an event handler is available.
int max_attacks() const
Definition: types.hpp:161
bool hide_help_
Definition: types.hpp:346
std::vector< ability_metadata > adv_abilities_
Definition: types.hpp:344
const t_string & variation_name() const
Definition: types.hpp:164
const variations_map & variation_types() const
Definition: types.hpp:245
const unit_race * race() const
Never returns nullptr, but may point to the null race.
Definition: types.hpp:264
const unit_type & get_gender_unit_type(std::string gender) const
Returns a gendered variant of this unit_type.
Definition: types.cpp:454
static void check_id(std::string &id)
Validate the id argument.
Definition: types.cpp:1352
double hp_bar_scaling() const
Definition: types.hpp:152
std::unique_ptr< unit_type > create_sub_type(const config &var_cfg, bool default_inherit)
Handles inheritance for configs of [male], [female], and [variation].
Definition: types.cpp:950
const config & child_or_empty(config_key_type key) const
Returns the first child with the given key, or an empty config if there is none.
Definition: config.cpp:453
const_attack_itors attacks() const
Definition: types.cpp:512
std::map< std::string, unit_race > race_map
Definition: race.hpp:94
bool can_advance() const
Definition: types.hpp:213
boost::iterator_range< boost::indirect_iterator< attack_list::const_iterator > > const_attack_itors
t_string unit_description() const
Definition: types.cpp:485
A config object defines a single node in a WML file, with access to child nodes.
Definition: config.hpp:68
static std::string alignment_description(ALIGNMENT align, unit_race::GENDER gender=unit_race::MALE)
attack_list attacks_cache_
Definition: types.hpp:305
bool has_random_traits() const
Definition: types.cpp:694
ALIGNMENT alignment() const
Definition: types.hpp:184
bool has_variation(const std::string &variation_id) const
Definition: types.cpp:726
Defines the MAKE_ENUM macro.
std::string image_
Definition: types.hpp:327
race_map races_
Definition: types.hpp:406
config::const_child_itors advancements() const
Definition: types.hpp:228
std::vector< unit_race::GENDER > genders_
Definition: types.hpp:358
const std::string & default_variation() const
Definition: types.hpp:163
std::map< std::string, unit_type > variations_map
Definition: types.hpp:94
void build_created()
Load the most needed data into an empty unit_type (build to CREATE).
Definition: types.cpp:376