24 #define ERR_G LOG_STREAM(err, lg::general())
25 #define LOG_G LOG_STREAM(info, lg::general())
26 #define DBG_G LOG_STREAM(debug, lg::general())
44 DBG_G <<
"create_terrain_maps: " << terrain.
number() <<
" "
53 <<
": " << terrain.
id() <<
" (" << terrain.
name() <<
")";
56 std::set<std::string> egs;
57 bool clean_merge =
true;
58 for (std::string&
t : eg1) {
59 clean_merge &= egs.insert(
t).second;
61 for (std::string&
t : eg2) {
62 clean_merge &= egs.insert(
t).second;
67 LOG_G <<
"Editor groups merged to: " << joined;
70 <<
": " << terrain.
id() <<
" (" << terrain.
name() <<
") "
71 <<
"with duplicate editor groups [" << terrain.
editor_group() <<
"] "
72 <<
"and [" <<
curr.editor_group() <<
"]";
74 curr.set_editor_group(joined);
76 ERR_G <<
"Duplicate terrain code definition found for " << terrain.
number() <<
"\n"
77 <<
"Failed to add terrain " << terrain.
id() <<
" (" << terrain.
name() <<
") "
79 <<
"which conflicts with " <<
curr.id() <<
" (" <<
curr.name() <<
") "
80 <<
"[" <<
curr.editor_group() <<
"]" <<
"\n";
126 return i->second.mvt_type();
139 return i->second.def_type();
152 return i->second.union_type();
191 assert(!underlying.empty());
193 if(underlying.size() > 1 || underlying[0] != terrain) {
195 t_translation::ter_list::const_iterator
i = underlying.begin();
197 while (++
i != underlying.end()) {
214 DBG_G <<
"find_or_create: creating terrain " << terrain;
227 terrain_type new_terrain(base_iter->second, overlay_iter->second);
250 else if(mode ==
BASE) {
A config object defines a single node in a WML file, with access to child nodes.
A class grating read only view to a vector of config objects, viewed as one config with all children ...
config_array_view child_range(config_key_type key) const
t_translation::ter_list terrainList_
void lazy_initialization() const
On the first call to this function, parse all of the [terrain_type]s that are defined in WML.
t_string get_underlying_terrain_string(const t_translation::terrain_code &terrain) const
const t_translation::ter_list & underlying_def_terrain(const t_translation::terrain_code &terrain) const
The underlying defense type of the terrain.
t_string get_terrain_string(const t_translation::terrain_code &terrain) const
Get a formatted terrain name – terrain (underlying terrains)
tcodeToTerrain_t tcodeToTerrain_
const game_config_view & game_config_
bool is_known(const t_translation::terrain_code &terrain) const
Returns true if get_terrain_info(terrain) would succeed, or false if get_terrain_info(terrain) would ...
const t_translation::ter_list & underlying_mvt_terrain(const t_translation::terrain_code &terrain) const
The underlying movement type of the terrain.
t_translation::terrain_code merge_terrains(const t_translation::terrain_code &old_t, const t_translation::terrain_code &new_t, const merge_mode mode, bool replace_if_failed=false) const
Tries to find a new terrain which is the combination of old and new terrain using the merge_settings.
const std::map< t_translation::terrain_code, terrain_type > & map() const
tcodeToTerrain_t::const_iterator find_or_create(t_translation::terrain_code) const
const terrain_type & get_terrain_info(const t_translation::terrain_code &terrain) const
Get the corresponding terrain_type information object for a given type of terrain.
const t_translation::ter_list & underlying_union_terrain(const t_translation::terrain_code &terrain) const
Unordered set of all terrains used in either underlying_mvt_terrain or underlying_def_terrain.
t_string get_terrain_editor_string(const t_translation::terrain_code &terrain) const
terrain_type_data(const game_config_view &game_config)
const t_translation::ter_list & list() const
const std::string & editor_group() const
const t_string & name() const
t_translation::terrain_code terrain_with_default_base() const
Return the overlay part of this terrain, on the default_base().
const std::string & id() const
const t_string & description() const
const t_string & editor_name() const
t_translation::terrain_code number() const
Standard logging facilities (interface).
Game configuration data as global variables.
std::string default_terrain
std::vector< terrain_code > ter_list
const terrain_code NONE_TERRAIN
std::string join(const T &v, const std::string &s=",")
Generates a new string joining container items in a list.
std::vector< std::string > split(const config_attribute_value &val)
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...