24 #define ERR_G LOG_STREAM(err, lg::general())
25 #define WRN_G LOG_STREAM(warn, lg::general())
26 #define LOG_G LOG_STREAM(info, lg::general())
27 #define DBG_G LOG_STREAM(debug, lg::general())
36 minimap_image_overlay_(),
49 height_adjust_set_(false),
52 light_modification_(0),
56 income_description_(),
57 income_description_ally_(),
58 income_description_enemy_(),
59 income_description_own_(),
68 hide_in_editor_(false),
69 hide_if_impassable_(false)
73 icon_image_(cfg[
"icon_image"]),
74 minimap_image_(cfg[
"symbol_image"]),
75 minimap_image_overlay_(),
76 editor_image_(cfg[
"editor_image"].empty() ?
"terrain/" + minimap_image_ +
".png" :
"terrain/" + cfg[
"editor_image"].str() +
".png"),
78 name_(cfg[
"name"].t_str()),
79 editor_name_(cfg[
"editor_name"].t_str()),
80 description_(cfg[
"description"].t_str()),
81 help_topic_text_(cfg[
"help_topic_text"].t_str()),
87 height_adjust_(cfg[
"unit_height_adjust"].to_int()),
88 height_adjust_set_(!cfg[
"unit_height_adjust"].empty()),
89 submerge_(cfg[
"submerge"].to_double()),
90 submerge_set_(!cfg[
"submerge"].empty()),
91 light_modification_(cfg[
"light"].to_int()),
92 max_light_(cfg[
"max_light"].to_int(light_modification_)),
93 min_light_(cfg[
"min_light"].to_int(light_modification_)),
94 heals_(cfg[
"heals"].to_int()),
95 income_description_(),
96 income_description_ally_(),
97 income_description_enemy_(),
98 income_description_own_(),
99 editor_group_(cfg[
"editor_group"]),
100 village_(cfg[
"gives_income"].to_bool()),
101 castle_(cfg[
"recruit_onto"].to_bool()),
102 keep_(cfg[
"recruit_from"].to_bool()),
106 hide_help_(cfg[
"hide_help"].to_bool(false)),
107 hide_in_editor_(cfg[
"hidden"].to_bool(false)),
108 hide_if_impassable_(cfg[
"hide_if_impassable"].to_bool(false))
147 if(!mvt_alias.empty()) {
152 if(!def_alias.empty()) {
157 if(!vision_alias.empty()) {
208 minimap_image_(base.minimap_image_),
209 minimap_image_overlay_(
overlay.minimap_image_),
210 editor_image_(base.editor_image_ +
"~BLIT(" +
overlay.editor_image_ +
")"),
213 editor_name_((base.editor_name_.empty() ? base.name_ : base.editor_name_) +
" / " + (
overlay.editor_name_.empty() ?
overlay.name_ :
overlay.editor_name_)),
214 description_(
overlay.description()),
218 vision_type_(
overlay.vision_type_),
221 height_adjust_(base.height_adjust_),
222 height_adjust_set_(base.height_adjust_set_),
223 submerge_(base.submerge_),
224 submerge_set_(base.submerge_set_),
225 light_modification_(base.light_modification_ +
overlay.light_modification_),
226 max_light_(std::max(base.max_light_,
overlay.max_light_)),
227 min_light_(std::min(base.min_light_,
overlay.min_light_)),
228 heals_(std::max<int>(base.heals_,
overlay.heals_)),
229 income_description_(),
230 income_description_ally_(),
231 income_description_enemy_(),
232 income_description_own_(),
234 village_(base.village_ ||
overlay.village_),
235 castle_(base.castle_ ||
overlay.castle_),
236 keep_(base.keep_ ||
overlay.keep_),
239 editor_default_base_(),
241 hide_in_editor_(base.hide_in_editor_ ||
overlay.hide_in_editor_),
242 hide_if_impassable_(base.hide_if_impassable_ ||
overlay.hide_if_impassable_)
248 if(
overlay.height_adjust_set_) {
339 for(
i = first.begin();
i != first.end(); ++
i) {
369 first.insert(insert_it, second.begin(), second.end());
A config object defines a single node in a WML file, with access to child nodes.
std::string base_str() const
bool has_default_base() const
t_string income_description_
std::string editor_image_
The image used in the editor palette if not defined in WML it will be initialized with the value of m...
t_translation::terrain_code editor_default_base_
t_translation::terrain_code terrain_with_default_base() const
Return the overlay part of this terrain, on the default_base().
t_translation::ter_list mvt_type_
std::string minimap_image_overlay_
t_translation::terrain_code number_
t_string income_description_ally_
t_translation::ter_list union_type_
t_translation::ter_list def_type_
const t_string & description() const
std::string minimap_image_
The image used in the minimap.
terrain_type()
Creates an instance for which is_nonnull() returns false.
t_string income_description_own_
t_translation::ter_list vision_type_
t_string income_description_enemy_
bool operator==(const terrain_type &other) const
Returns true if most of the data matches.
std::string deprecated_message(const std::string &elem_name, DEP_LEVEL level, const version_info &version, const std::string &detail)
Interfaces for manipulating version numbers of engine, add-ons, etc.
static std::string _(const char *str)
Standard logging facilities (interface).
void remove()
Removes a tip.
terrain_code read_terrain_code(std::string_view str, const ter_layer filler)
Reads a single terrain from a string.
const terrain_code VOID_TERRAIN
VOID_TERRAIN is used for shrouded hexes.
std::vector< terrain_code > ter_list
ter_list read_list(std::string_view str, const ter_layer filler)
Reads a list of terrains from a string, when reading the.
std::string write_terrain_code(const terrain_code &tcode)
Writes a single terrain code to a string.
const terrain_code NONE_TERRAIN
std::string::const_iterator iterator
A terrain string which is converted to a terrain is a string with 1 or 2 layers the layers are separa...
void merge_alias_lists(t_translation::ter_list &first, const t_translation::ter_list &second)
Insert second vector into first when the terrain _ref^base is encountered.
static lg::log_domain log_config("config")
std::string missing_mandatory_wml_key(const std::string §ion, const std::string &key, const std::string &primary_key, const std::string &primary_value)
Returns a standard message for a missing wml key (attribute).
#define VALIDATE(cond, message)
The macro to use for the validation of WML.