Format some ctor lists (no content changes)
This commit is contained in:
parent
c5069a6036
commit
8b86256e4a
4 changed files with 140 additions and 139 deletions
|
@ -27,42 +27,42 @@ static lg::log_domain log_audio("audio");
|
|||
|
||||
namespace sound {
|
||||
|
||||
music_track::music_track() :
|
||||
id_(),
|
||||
file_path_(),
|
||||
ms_before_(0),
|
||||
ms_after_(0),
|
||||
once_(false),
|
||||
append_(false),
|
||||
immediate_(false),
|
||||
shuffle_(true)
|
||||
music_track::music_track()
|
||||
: id_()
|
||||
, file_path_()
|
||||
, ms_before_(0)
|
||||
, ms_after_(0)
|
||||
, once_(false)
|
||||
, append_(false)
|
||||
, immediate_(false)
|
||||
, shuffle_(true)
|
||||
{
|
||||
}
|
||||
|
||||
music_track::music_track(const config& node) :
|
||||
id_(node["name"]),
|
||||
file_path_(),
|
||||
title_(node["title"]),
|
||||
ms_before_(node["ms_before"].to_int()),
|
||||
ms_after_(node["ms_after"].to_int()),
|
||||
once_(node["play_once"].to_bool()),
|
||||
append_(node["append"].to_bool()),
|
||||
immediate_(node["immediate"].to_bool()),
|
||||
shuffle_(node["shuffle"].to_bool(true))
|
||||
music_track::music_track(const config& node)
|
||||
: id_(node["name"])
|
||||
, file_path_()
|
||||
, title_(node["title"])
|
||||
, ms_before_(node["ms_before"].to_int())
|
||||
, ms_after_(node["ms_after"].to_int())
|
||||
, once_(node["play_once"].to_bool())
|
||||
, append_(node["append"].to_bool())
|
||||
, immediate_(node["immediate"].to_bool())
|
||||
, shuffle_(node["shuffle"].to_bool(true))
|
||||
{
|
||||
resolve();
|
||||
}
|
||||
|
||||
music_track::music_track(const std::string& v_name) :
|
||||
id_(v_name),
|
||||
file_path_(),
|
||||
title_(),
|
||||
ms_before_(0),
|
||||
ms_after_(0),
|
||||
once_(false),
|
||||
append_(false),
|
||||
immediate_(false),
|
||||
shuffle_(true)
|
||||
music_track::music_track(const std::string& v_name)
|
||||
: id_(v_name)
|
||||
, file_path_()
|
||||
, title_()
|
||||
, ms_before_(0)
|
||||
, ms_after_(0)
|
||||
, once_(false)
|
||||
, append_(false)
|
||||
, immediate_(false)
|
||||
, shuffle_(true)
|
||||
{
|
||||
resolve();
|
||||
}
|
||||
|
|
|
@ -234,17 +234,17 @@ void sourcespec::write(config& cfg) const
|
|||
write_locations(locations_, cfg);
|
||||
}
|
||||
|
||||
sourcespec::sourcespec(const config& cfg) :
|
||||
id_(cfg["id"]),
|
||||
files_(cfg["sounds"]),
|
||||
min_delay_(cfg["delay"].to_int(DEFAULT_DELAY)),
|
||||
chance_(cfg["chance"].to_int(DEFAULT_CHANCE)),
|
||||
loops_(cfg["loop"].to_int()),
|
||||
range_(cfg["full_range"].to_int(3)),
|
||||
faderange_(cfg["fade_range"].to_int(14)),
|
||||
check_fogged_(cfg["check_fogged"].to_bool(true)),
|
||||
check_shrouded_(cfg["check_shrouded"].to_bool(true)),
|
||||
locations_()
|
||||
sourcespec::sourcespec(const config& cfg)
|
||||
: id_(cfg["id"])
|
||||
, files_(cfg["sounds"])
|
||||
, min_delay_(cfg["delay"].to_int(DEFAULT_DELAY))
|
||||
, chance_(cfg["chance"].to_int(DEFAULT_CHANCE))
|
||||
, loops_(cfg["loop"].to_int())
|
||||
, range_(cfg["full_range"].to_int(3))
|
||||
, faderange_(cfg["fade_range"].to_int(14))
|
||||
, check_fogged_(cfg["check_fogged"].to_bool(true))
|
||||
, check_shrouded_(cfg["check_shrouded"].to_bool(true))
|
||||
, locations_()
|
||||
{
|
||||
read_locations(cfg, locations_);
|
||||
}
|
||||
|
|
|
@ -31,81 +31,83 @@ static lg::log_domain log_config("config");
|
|||
*/
|
||||
void merge_alias_lists(t_translation::ter_list& first, const t_translation::ter_list& second);
|
||||
|
||||
terrain_type::terrain_type() :
|
||||
minimap_image_(),
|
||||
minimap_image_overlay_(),
|
||||
editor_image_(),
|
||||
id_(),
|
||||
name_(),
|
||||
editor_name_(),
|
||||
description_(),
|
||||
help_topic_text_(),
|
||||
number_(t_translation::VOID_TERRAIN),
|
||||
mvt_type_(1, t_translation::VOID_TERRAIN),
|
||||
vision_type_(1, t_translation::VOID_TERRAIN),
|
||||
def_type_(1, t_translation::VOID_TERRAIN),
|
||||
union_type_(1, t_translation::VOID_TERRAIN),
|
||||
height_adjust_(0),
|
||||
height_adjust_set_(false),
|
||||
submerge_(0.0),
|
||||
submerge_set_(false),
|
||||
light_modification_(0),
|
||||
max_light_(0),
|
||||
min_light_(0),
|
||||
heals_(0),
|
||||
income_description_(),
|
||||
income_description_ally_(),
|
||||
income_description_enemy_(),
|
||||
income_description_own_(),
|
||||
editor_group_(),
|
||||
village_(false),
|
||||
castle_(false),
|
||||
keep_(false),
|
||||
overlay_(false),
|
||||
combined_(false),
|
||||
editor_default_base_(t_translation::VOID_TERRAIN),
|
||||
hide_help_(false),
|
||||
hide_in_editor_(false),
|
||||
hide_if_impassable_(false)
|
||||
{}
|
||||
terrain_type::terrain_type()
|
||||
: minimap_image_()
|
||||
, minimap_image_overlay_()
|
||||
, editor_image_()
|
||||
, id_()
|
||||
, name_()
|
||||
, editor_name_()
|
||||
, description_()
|
||||
, help_topic_text_()
|
||||
, number_(t_translation::VOID_TERRAIN)
|
||||
, mvt_type_(1, t_translation::VOID_TERRAIN)
|
||||
, vision_type_(1, t_translation::VOID_TERRAIN)
|
||||
, def_type_(1, t_translation::VOID_TERRAIN)
|
||||
, union_type_(1, t_translation::VOID_TERRAIN)
|
||||
, height_adjust_(0)
|
||||
, height_adjust_set_(false)
|
||||
, submerge_(0.0)
|
||||
, submerge_set_(false)
|
||||
, light_modification_(0)
|
||||
, max_light_(0)
|
||||
, min_light_(0)
|
||||
, heals_(0)
|
||||
, income_description_()
|
||||
, income_description_ally_()
|
||||
, income_description_enemy_()
|
||||
, income_description_own_()
|
||||
, editor_group_()
|
||||
, village_(false)
|
||||
, castle_(false)
|
||||
, keep_(false)
|
||||
, overlay_(false)
|
||||
, combined_(false)
|
||||
, editor_default_base_(t_translation::VOID_TERRAIN)
|
||||
, hide_help_(false)
|
||||
, hide_in_editor_(false)
|
||||
, hide_if_impassable_(false)
|
||||
{
|
||||
}
|
||||
|
||||
terrain_type::terrain_type(const config& cfg) :
|
||||
icon_image_(cfg["icon_image"]),
|
||||
minimap_image_(cfg["symbol_image"]),
|
||||
minimap_image_overlay_(),
|
||||
editor_image_(cfg["editor_image"].empty() ? "terrain/" + minimap_image_ + ".png" : "terrain/" + cfg["editor_image"].str() + ".png"),
|
||||
id_(cfg["id"]),
|
||||
name_(cfg["name"].t_str()),
|
||||
editor_name_(cfg["editor_name"].t_str()),
|
||||
description_(cfg["description"].t_str()),
|
||||
help_topic_text_(cfg["help_topic_text"].t_str()),
|
||||
number_(t_translation::read_terrain_code(cfg["string"].str())),
|
||||
mvt_type_(),
|
||||
vision_type_(),
|
||||
def_type_(),
|
||||
union_type_(),
|
||||
height_adjust_(cfg["unit_height_adjust"].to_int()),
|
||||
height_adjust_set_(!cfg["unit_height_adjust"].empty()),
|
||||
submerge_(cfg["submerge"].to_double()),
|
||||
submerge_set_(!cfg["submerge"].empty()),
|
||||
light_modification_(cfg["light"].to_int()),
|
||||
max_light_(cfg["max_light"].to_int(light_modification_)),
|
||||
min_light_(cfg["min_light"].to_int(light_modification_)),
|
||||
heals_(cfg["heals"].to_int()),
|
||||
income_description_(),
|
||||
income_description_ally_(),
|
||||
income_description_enemy_(),
|
||||
income_description_own_(),
|
||||
editor_group_(cfg["editor_group"]),
|
||||
village_(cfg["gives_income"].to_bool()),
|
||||
castle_(cfg["recruit_onto"].to_bool()),
|
||||
keep_(cfg["recruit_from"].to_bool()),
|
||||
overlay_(number_.base == t_translation::NO_LAYER),
|
||||
combined_(false),
|
||||
editor_default_base_(t_translation::read_terrain_code(cfg["default_base"].str())),
|
||||
hide_help_(cfg["hide_help"].to_bool(false)),
|
||||
hide_in_editor_(cfg["hidden"].to_bool(false)),
|
||||
hide_if_impassable_(cfg["hide_if_impassable"].to_bool(false))
|
||||
terrain_type::terrain_type(const config& cfg)
|
||||
: icon_image_(cfg["icon_image"])
|
||||
, minimap_image_(cfg["symbol_image"])
|
||||
, minimap_image_overlay_()
|
||||
, editor_image_(cfg["editor_image"].empty() ? "terrain/" + minimap_image_ + ".png"
|
||||
: "terrain/" + cfg["editor_image"].str() + ".png")
|
||||
, id_(cfg["id"])
|
||||
, name_(cfg["name"].t_str())
|
||||
, editor_name_(cfg["editor_name"].t_str())
|
||||
, description_(cfg["description"].t_str())
|
||||
, help_topic_text_(cfg["help_topic_text"].t_str())
|
||||
, number_(t_translation::read_terrain_code(cfg["string"].str()))
|
||||
, mvt_type_()
|
||||
, vision_type_()
|
||||
, def_type_()
|
||||
, union_type_()
|
||||
, height_adjust_(cfg["unit_height_adjust"].to_int())
|
||||
, height_adjust_set_(!cfg["unit_height_adjust"].empty())
|
||||
, submerge_(cfg["submerge"].to_double())
|
||||
, submerge_set_(!cfg["submerge"].empty())
|
||||
, light_modification_(cfg["light"].to_int())
|
||||
, max_light_(cfg["max_light"].to_int(light_modification_))
|
||||
, min_light_(cfg["min_light"].to_int(light_modification_))
|
||||
, heals_(cfg["heals"].to_int())
|
||||
, income_description_()
|
||||
, income_description_ally_()
|
||||
, income_description_enemy_()
|
||||
, income_description_own_()
|
||||
, editor_group_(cfg["editor_group"])
|
||||
, village_(cfg["gives_income"].to_bool())
|
||||
, castle_(cfg["recruit_onto"].to_bool())
|
||||
, keep_(cfg["recruit_from"].to_bool())
|
||||
, overlay_(number_.base == t_translation::NO_LAYER)
|
||||
, combined_(false)
|
||||
, editor_default_base_(t_translation::read_terrain_code(cfg["default_base"].str()))
|
||||
, hide_help_(cfg["hide_help"].to_bool(false))
|
||||
, hide_in_editor_(cfg["hidden"].to_bool(false))
|
||||
, hide_if_impassable_(cfg["hide_if_impassable"].to_bool(false))
|
||||
{
|
||||
/**
|
||||
* @todo reenable these validations. The problem is that all MP
|
||||
|
|
|
@ -46,37 +46,36 @@ static const config &empty_topics() {
|
|||
return cfg;
|
||||
}
|
||||
|
||||
unit_race::unit_race() :
|
||||
cfg_(),
|
||||
id_(),
|
||||
name_(),
|
||||
plural_name_(),
|
||||
description_(),
|
||||
ntraits_(0),
|
||||
traits_(empty_traits().child_range("trait")),
|
||||
topics_(empty_topics().child_range("topic")),
|
||||
global_traits_(true),
|
||||
undead_variation_(),
|
||||
help_taxonomy_()
|
||||
unit_race::unit_race()
|
||||
: cfg_()
|
||||
, id_()
|
||||
, name_()
|
||||
, plural_name_()
|
||||
, description_()
|
||||
, ntraits_(0)
|
||||
, traits_(empty_traits().child_range("trait"))
|
||||
, topics_(empty_topics().child_range("topic"))
|
||||
, global_traits_(true)
|
||||
, undead_variation_()
|
||||
, help_taxonomy_()
|
||||
{
|
||||
for(auto& generator : name_generator_) {
|
||||
generator.reset(new name_generator());
|
||||
}
|
||||
}
|
||||
|
||||
unit_race::unit_race(const config& cfg) :
|
||||
cfg_(cfg),
|
||||
id_(cfg["id"]),
|
||||
icon_(cfg["editor_icon"]),
|
||||
plural_name_(cfg["plural_name"].t_str()),
|
||||
description_(cfg["description"].t_str()),
|
||||
ntraits_(cfg["num_traits"].to_int()),
|
||||
traits_(cfg.child_range("trait")),
|
||||
topics_(cfg.child_range("topic")),
|
||||
global_traits_(!cfg["ignore_global_traits"].to_bool()),
|
||||
undead_variation_(cfg["undead_variation"]),
|
||||
help_taxonomy_(cfg["help_taxonomy"])
|
||||
|
||||
unit_race::unit_race(const config& cfg)
|
||||
: cfg_(cfg)
|
||||
, id_(cfg["id"])
|
||||
, icon_(cfg["editor_icon"])
|
||||
, plural_name_(cfg["plural_name"].t_str())
|
||||
, description_(cfg["description"].t_str())
|
||||
, ntraits_(cfg["num_traits"].to_int())
|
||||
, traits_(cfg.child_range("trait"))
|
||||
, topics_(cfg.child_range("topic"))
|
||||
, global_traits_(!cfg["ignore_global_traits"].to_bool())
|
||||
, undead_variation_(cfg["undead_variation"])
|
||||
, help_taxonomy_(cfg["help_taxonomy"])
|
||||
{
|
||||
if (plural_name_.empty()) {
|
||||
lg::log_to_chat() << "[race] id='" << id_ << "' is missing a plural_name field.\n";
|
||||
|
|
Loading…
Add table
Reference in a new issue