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())
65 DBG_G <<
"create_terrain_maps: " << terrain.
number() <<
" "
68 std::pair<std::map<t_translation::terrain_code, terrain_type>::iterator,
bool>
res;
74 <<
": " << terrain.
id() <<
" (" << terrain.
name() <<
")";
77 std::set<std::string>
egs;
79 for (std::string&
t :
eg1) {
82 for (std::string&
t :
eg2) {
91 <<
": " << terrain.
id() <<
" (" << terrain.
name() <<
") "
92 <<
"with duplicate editor groups [" << terrain.
editor_group() <<
"] "
93 <<
"and [" <<
curr.editor_group() <<
"]";
97 ERR_G <<
"Duplicate terrain code definition found for " << terrain.
number() <<
"\n"
98 <<
"Failed to add terrain " << terrain.
id() <<
" (" << terrain.
name() <<
") "
100 <<
"which conflicts with " <<
curr.id() <<
" (" <<
curr.name() <<
") "
101 <<
"[" <<
curr.editor_group() <<
"]" <<
"\n";
131 return default_terrain;
171 t_translation::ter_list::const_iterator
i =
underlying.begin();
190 DBG_G <<
"find_or_create: creating terrain " << terrain;
226 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(std::string_view key) const
Contains the database of all known terrain types, both those defined explicitly by WML [terrain_type]...
void reset() const
Clears the database and queues reinitialization on the next call to lazy_initialization.
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
t_string get_terrain_string(const t_translation::terrain_code &terrain) const
Get a formatted terrain name – terrain (underlying terrains)
static terrain_type_data * singleton_
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 ...
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.
static terrain_type_data * get()
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.
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
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 & name() const
const std::string & editor_group() const
const t_translation::ter_list & union_type() const
t_translation::terrain_code number() const
const t_string & description() const
const t_string & editor_name() const
Standard logging facilities (interface).
Game configuration data as global variables.
constexpr terrain_code NONE_TERRAIN
std::vector< terrain_code > ter_list
constexpr ter_layer NO_LAYER
std::string join(const Range &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)
A terrain string which is converted to a terrain is a string with 1 or 2 layers the layers are separa...