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)
51 , submerge_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)
74 : icon_image_(cfg[
"icon_image"])
75 , minimap_image_(cfg[
"symbol_image"])
76 , minimap_image_overlay_()
77 , editor_image_(cfg[
"editor_image"].empty() ?
"terrain/" + minimap_image_ +
".png"
78 :
"terrain/" + cfg[
"editor_image"].str() +
".png")
80 , name_(cfg[
"name"].t_str())
81 , editor_name_(cfg[
"editor_name"].t_str())
82 , description_(cfg[
"description"].t_str())
83 , help_topic_text_(cfg[
"help_topic_text"].t_str())
89 , height_adjust_(cfg[
"unit_height_adjust"].to_int())
90 , height_adjust_set_(!cfg[
"unit_height_adjust"].empty())
91 , submerge_(cfg[
"submerge"].to_double())
92 , submerge_set_(!cfg[
"submerge"].empty())
93 , light_modification_(cfg[
"light"].to_int())
94 , max_light_(cfg[
"max_light"].to_int(light_modification_))
95 , min_light_(cfg[
"min_light"].to_int(light_modification_))
96 , heals_(cfg[
"heals"].to_int())
97 , income_description_()
98 , income_description_ally_()
99 , income_description_enemy_()
100 , income_description_own_()
101 , editor_group_(cfg[
"editor_group"])
102 , village_(cfg[
"gives_income"].to_bool())
103 , castle_(cfg[
"recruit_onto"].to_bool())
104 , keep_(cfg[
"recruit_from"].to_bool())
108 , hide_help_(cfg[
"hide_help"].to_bool(false))
109 , hide_in_editor_(cfg[
"hidden"].to_bool(false))
110 , hide_if_impassable_(cfg[
"hide_if_impassable"].to_bool(false))
149 if(!mvt_alias.empty()) {
154 if(!def_alias.empty()) {
159 if(!vision_alias.empty()) {
207 minimap_image_(base.minimap_image_),
208 minimap_image_overlay_(
overlay.minimap_image_),
209 editor_image_(base.editor_image_ +
"~BLIT(" +
overlay.editor_image_ +
")"),
212 editor_name_((base.editor_name_.empty() ? base.name_ : base.editor_name_) +
" / " + (
overlay.editor_name_.empty() ?
overlay.name_ :
overlay.editor_name_)),
213 description_(
overlay.description()),
217 vision_type_(
overlay.vision_type_),
220 height_adjust_(base.height_adjust_),
221 height_adjust_set_(base.height_adjust_set_),
222 submerge_(base.submerge_),
223 submerge_set_(base.submerge_set_),
224 light_modification_(base.light_modification_ +
overlay.light_modification_),
225 max_light_(std::max(base.max_light_,
overlay.max_light_)),
226 min_light_(std::min(base.min_light_,
overlay.min_light_)),
227 heals_(std::max<int>(base.heals_,
overlay.heals_)),
228 income_description_(),
229 income_description_ally_(),
230 income_description_enemy_(),
231 income_description_own_(),
233 village_(base.village_ ||
overlay.village_),
234 castle_(base.castle_ ||
overlay.castle_),
235 keep_(base.keep_ ||
overlay.keep_),
238 editor_default_base_(),
240 hide_in_editor_(base.hide_in_editor_ ||
overlay.hide_in_editor_),
241 hide_if_impassable_(base.hide_if_impassable_ ||
overlay.hide_if_impassable_)
247 if(
overlay.height_adjust_set_) {
335 for(
i = first.begin();
i != first.end(); ++
i) {
365 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).
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::size_t erase(Container &container, const Value &value)
Convenience wrapper for using std::remove on a container.
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.