The Battle for Wesnoth  1.19.5+dev
Classes | Typedefs | Functions | Variables
t_translation Namespace Reference

Classes

struct  terrain_code
 A terrain string which is converted to a terrain is a string with 1 or 2 layers the layers are separated by a caret and each group consists of 2 to 4 characters if no second layer is defined it is stored as 0xFFFFFFFF, if the second layer is empty (needed for matching) the layer has the value 0. More...
 
struct  ter_map
 
struct  ter_match
 This structure can be used for matching terrain strings. More...
 
struct  error
 

Typedefs

typedef uint32_t ter_layer
 
typedef std::vector< terrain_codeter_list
 
using coordinate = map_location
 Contains an x and y coordinate used for starting positions in maps. More...
 
using starting_positions = boost::bimaps::bimap< boost::bimaps::set_of< std::string >, boost::bimaps::multiset_of< coordinate > >
 

Functions

int max_map_size ()
 Return the maximum allowed map size (in either dimension), the maximum map area is, therefore, this value squared. More...
 
static ter_layer get_layer_mask_ (ter_layer terrain)
 Get the mask for a single layer. More...
 
static terrain_code get_mask_ (const terrain_code &terrain)
 Gets a mask for a terrain, this mask is used for wildcard matching. More...
 
static ter_layer string_to_layer_ (std::string_view str)
 
static ter_layer string_to_layer_ (const std::string &str)
 Converts a string to a layer. More...
 
static terrain_code string_to_number_ (std::string_view str, std::vector< std::string > &start_positions, const ter_layer filler)
 Converts a terrain string to a number. More...
 
static terrain_code string_to_number_ (std::string_view str, const ter_layer filler=NO_LAYER)
 
static std::string number_to_string_ (terrain_code terrain, const std::vector< std::string > &start_position=std::vector< std::string >())
 Converts a terrain number to a string. More...
 
static terrain_code string_to_builder_number_ (std::string str)
 Converts a terrain string to a number for the builder. More...
 
const ter_match ALL_OFF_MAP ("_off^_usr,*^_fme")
 
const ter_match ALL_FORESTS ("F*,*^F*")
 
terrain_code read_terrain_code (std::string_view str, const ter_layer filler=NO_LAYER)
 Reads a single terrain from a string. More...
 
std::string write_terrain_code (const terrain_code &tcode)
 Writes a single terrain code to a string. More...
 
ter_list read_list (std::string_view str, const ter_layer filler=NO_LAYER)
 Reads a list of terrains from a string, when reading the. More...
 
std::string write_list (const ter_list &list)
 Writes a list of terrains to a string, only writes the new format. More...
 
static std::pair< int, int > get_map_size (const char *begin, const char *end)
 
ter_map read_game_map (std::string_view str, starting_positions &positions, coordinate border_offset=coordinate{ 0, 0 })
 Reads a gamemap string into a 2D vector. More...
 
std::string write_game_map (const ter_map &map, const starting_positions &positions=starting_positions(), coordinate border_offset=coordinate{ 0, 0 })
 Write a gamemap in to a vector string. More...
 
bool terrain_matches (const terrain_code &src, const terrain_code &dest)
 Tests whether a specific terrain matches an expression, for matching rules see above. More...
 
bool terrain_matches (const terrain_code &src, const ter_list &dest)
 Tests whether a specific terrain matches a list of expressions. More...
 
bool terrain_matches (const terrain_code &src, const ter_match &dest)
 Tests whether a certain terrain matches a list of expressions, for matching rules see above. More...
 
bool has_wildcard (const terrain_code &tcode)
 Tests whether a terrain code contains a wildcard. More...
 
bool has_wildcard (const ter_list &list)
 Tests whether a terrain-code list contains at least one item with a wildcard. More...
 
ter_map read_builder_map (const std::string &str)
 Reads a builder map. More...
 
bool operator< (const terrain_code &a, const terrain_code &b)
 
bool operator== (const terrain_code &a, const terrain_code &b)
 
bool operator!= (const terrain_code &a, const terrain_code &b)
 
terrain_code operator& (const terrain_code &a, const terrain_code &b)
 
terrain_code operator| (const terrain_code &a, const terrain_code &b)
 
std::ostream & operator<< (std::ostream &s, const terrain_code &a)
 

Variables

const terrain_code OFF_MAP_USER = string_to_number_("_off^_usr")
 
const terrain_code VOID_TERRAIN = string_to_number_("_s")
 VOID_TERRAIN is used for shrouded hexes. More...
 
const terrain_code FOGGED = string_to_number_("_f")
 
const terrain_code HUMAN_CASTLE = string_to_number_("Ch")
 
const terrain_code HUMAN_KEEP = string_to_number_("Kh")
 
const terrain_code SHALLOW_WATER = string_to_number_("Ww")
 
const terrain_code DEEP_WATER = string_to_number_("Wo")
 
const terrain_code GRASS_LAND = string_to_number_("Gg")
 
const terrain_code FOREST = string_to_number_("Gg^Ff")
 
const terrain_code MOUNTAIN = string_to_number_("Mm")
 
const terrain_code HILL = string_to_number_("Hh")
 
const terrain_code CAVE_WALL = string_to_number_("Xu")
 
const terrain_code CAVE = string_to_number_("Uu")
 
const terrain_code UNDERGROUND_VILLAGE = string_to_number_("Uu^Vu")
 
const terrain_code DWARVEN_CASTLE = string_to_number_("Cud")
 
const terrain_code DWARVEN_KEEP = string_to_number_("Kud")
 
const terrain_code PLUS = string_to_number_("+")
 
const terrain_code MINUS = string_to_number_("-")
 
const terrain_code NOT = string_to_number_("!")
 
const terrain_code STAR = string_to_number_("*")
 
const terrain_code BASE = string_to_number_("_bas")
 
const ter_match ALL_HILLS ("!,*^V*,!,H*")
 
const ter_match ALL_MOUNTAINS ("!,*^V*,!,M*")
 
const ter_match ALL_SWAMPS ("!,*^V*,*^B*,!,S*")
 
const ter_layer WILDCARD = 0x2A000000
 
const ter_layer NO_LAYER = 0xFFFFFFFF
 
const terrain_code NONE_TERRAIN = terrain_code()
 
const ter_match ALL_OFF_MAP
 
const ter_match ALL_FORESTS
 
const ter_layer TB_STAR = '*' << 24
 
const ter_layer TB_DOT = '.' << 24
 

Typedef Documentation

◆ coordinate

Contains an x and y coordinate used for starting positions in maps.

Definition at line 117 of file translation.hpp.

◆ starting_positions

using t_translation::starting_positions = typedef boost::bimaps::bimap<boost::bimaps::set_of<std::string>, boost::bimaps::multiset_of<coordinate> >

Definition at line 217 of file translation.hpp.

◆ ter_layer

typedef uint32_t t_translation::ter_layer

Definition at line 38 of file translation.hpp.

◆ ter_list

typedef std::vector<terrain_code> t_translation::ter_list

Definition at line 77 of file translation.hpp.

Function Documentation

◆ ALL_FORESTS()

const ter_match t_translation::ALL_FORESTS ( "F*  ,
*^F *"   
)

◆ ALL_OFF_MAP()

const ter_match t_translation::ALL_OFF_MAP ( "_off^  _usr,
*^_fme"   
)

◆ get_layer_mask_()

ter_layer t_translation::get_layer_mask_ ( ter_layer  terrain)
inlinestatic

Get the mask for a single layer.

Parameters
terrain1 layer of a terrain, might have a wildcard.
Returns
Mask for that layer.

Definition at line 670 of file translation.cpp.

Referenced by get_mask_(), and has_wildcard().

◆ get_map_size()

static std::pair<int, int> t_translation::get_map_size ( const char *  begin,
const char *  end 
)
static

Definition at line 267 of file translation.cpp.

References h, and w.

Referenced by read_builder_map(), and read_game_map().

◆ get_mask_()

static terrain_code t_translation::get_mask_ ( const terrain_code terrain)
static

Gets a mask for a terrain, this mask is used for wildcard matching.

Parameters
terrainThe terrain which might have a wildcard.
Returns
The mask for this terrain.

Definition at line 695 of file translation.cpp.

References t_translation::terrain_code::base, get_layer_mask_(), NO_LAYER, and t_translation::terrain_code::overlay.

Referenced by t_translation::ter_match::ter_match(), and terrain_matches().

◆ has_wildcard() [1/2]

bool t_translation::has_wildcard ( const ter_list list)

Tests whether a terrain-code list contains at least one item with a wildcard.

Parameters
listthe list to test for a wildcard
Returns
true if a wildcard found, else false

Definition at line 581 of file translation.cpp.

References has_wildcard().

◆ has_wildcard() [2/2]

bool t_translation::has_wildcard ( const terrain_code tcode)

Tests whether a terrain code contains a wildcard.

Parameters
tcodethe terrain code to test for a wildcard
Returns
true if wildcard found, else false

Definition at line 572 of file translation.cpp.

References t_translation::terrain_code::base, get_layer_mask_(), NO_LAYER, and t_translation::terrain_code::overlay.

Referenced by has_wildcard(), and terrain_matches().

◆ max_map_size()

int t_translation::max_map_size ( )

Return the maximum allowed map size (in either dimension), the maximum map area is, therefore, this value squared.

Definition at line 35 of file translation.cpp.

Referenced by read_game_map().

◆ number_to_string_()

static std::string t_translation::number_to_string_ ( terrain_code  terrain,
const std::vector< std::string > &  start_position = std::vector<std::string>() 
)
static

Converts a terrain number to a string.

Parameters
terrainThe terrain number to convert.
start_positionThe starting position, if smaller than 0 it's ignored else it's written.
Returns
The converted string, if no starting position given it's padded to 4 chars else padded to 7 chars.

Definition at line 775 of file translation.cpp.

References t_translation::terrain_code::base, i, NO_LAYER, and t_translation::terrain_code::overlay.

Referenced by write_game_map(), write_list(), and write_terrain_code().

◆ operator!=()

bool t_translation::operator!= ( const terrain_code a,
const terrain_code b 
)
inline

◆ operator&()

terrain_code t_translation::operator& ( const terrain_code a,
const terrain_code b 
)
inline

◆ operator<()

bool t_translation::operator< ( const terrain_code a,
const terrain_code b 
)
inline

◆ operator<<()

std::ostream& t_translation::operator<< ( std::ostream &  s,
const terrain_code a 
)
inline

Definition at line 194 of file translation.hpp.

References s, and write_terrain_code().

◆ operator==()

bool t_translation::operator== ( const terrain_code a,
const terrain_code b 
)
inline

◆ operator|()

terrain_code t_translation::operator| ( const terrain_code a,
const terrain_code b 
)
inline

◆ read_builder_map()

ter_map t_translation::read_builder_map ( const std::string &  str)

Reads a builder map.

A builder map differs a great deal from a normal map, hence the different functions.

Parameters
strThe map data, a terrain letter is either a * or a . or a number as anchor. The star or dot are stored in the base part of the terrain and the anchor in the overlay part. If more letters are allowed as special case they will be stored in the base part. Anchor 0 is no anchor.
Returns
A 2D vector with the data found the vector data is stored like result[y][x] where x the column number is and y the row number.

Definition at line 599 of file translation.cpp.

References t_translation::ter_map::get(), get_map_size(), t_translation::ter_map::h, utils::isnewline(), string_to_builder_number_(), TB_DOT, and t_translation::ter_map::w.

Referenced by terrain_builder::parse_mapstring().

◆ read_game_map()

ter_map t_translation::read_game_map ( std::string_view  str,
starting_positions positions,
coordinate  border_offset = coordinate{ 0, 0 } 
)

Reads a gamemap string into a 2D vector.

Parameters
strA string containing the gamemap, the following rules are stated for a gamemap:
  • The map is square
  • The map can be prefixed with one or more empty lines, these lines are ignored
  • The map can be postfixed with one or more empty lines, these lines are ignored
  • Every end of line can be followed by one or more empty lines, these lines are ignored.
Deprecated:
NOTE it's deprecated to use this feature.
  • Terrain strings are separated by comma's or an end of line symbol, for the last terrain string in the row. For readability it's allowed to pad strings with either spaces or tab, however the tab is deprecated.
  • A terrain string contains either a terrain or a terrain and starting location. The following format is used [S ]T S = starting location a positive non-zero number T = terrain code (see read_terrain_code)
Parameters
positionsThis parameter will be filled with the starting locations found. Starting locations can only occur once if multiple definitions occur of the same position only the last is stored. The returned value is a map:
  • first the starting locations
  • second a coordinate structure where the location was found
border_offset
Returns
A 2D vector with the terrains found the vector data is stored like result[x][y] where x the column number is and y the row number.

Definition at line 291 of file translation.cpp.

References ERR_G, t_translation::ter_map::get(), get_map_size(), t_translation::ter_map::h, utils::isnewline(), max_map_size(), NO_LAYER, string_to_number_(), t_translation::ter_map::w, WRN_G, map_location::x, and map_location::y.

Referenced by mapgen_gamemap::mapgen_gamemap(), and gamemap::read().

◆ read_list()

ter_list t_translation::read_list ( std::string_view  str,
const ter_layer  filler = NO_LAYER 
)

Reads a list of terrains from a string, when reading the.

Parameters
strA string with one or more terrain codes (see read_terrain_code)
fillerIf there's no layer, this value will be used as the second layer
Returns
A vector which contains the terrain codes found in the string

Definition at line 217 of file translation.cpp.

References string_to_number_().

Referenced by default_map_generator_job::default_generate_map(), prefs::load_preferences(), place_village(), placing_score(), read_rules_vector(), and terrain_type::terrain_type().

◆ read_terrain_code()

terrain_code t_translation::read_terrain_code ( std::string_view  str,
const ter_layer  filler = NO_LAYER 
)

Reads a single terrain from a string.

Parameters
strThe string which should contain 1 terrain code; the format of a terrain code is 2 to 4 characters in the set
*                  [a-zA-Z/|\_]
*
The underscore is intended for internal use. Other characters are reserved for future use. The * is used as wildcard in some cases. The terrain code can be two groups separated by a caret, the first group is the base terrain, the second the overlay terrain.
fillerif there's no layer this value will be used as the second layer
Returns
A single terrain code

Definition at line 207 of file translation.cpp.

References string_to_number_().

Referenced by game_board::change_terrain(), editor::context_manager::create_blank_context(), default_map_generator_job::default_generate_map(), wfl::gamestate::DEFINE_WFL_FUNCTION(), game_lua_kernel::impl_get_terrain_info(), impl_merge_terrain(), intf_terrainmap_create(), intf_unit_defense(), intf_unit_jamming_cost(), intf_unit_movement_cost(), and intf_unit_vision_cost().

◆ string_to_builder_number_()

static terrain_code t_translation::string_to_builder_number_ ( std::string  str)
static

Converts a terrain string to a number for the builder.

The translation rules differ from the normal conversion rules

Parameters
strThe terrain string.
Returns
Number for the builder map.

Definition at line 821 of file translation.cpp.

References lexical_cast_default().

Referenced by read_builder_map().

◆ string_to_layer_() [1/2]

static ter_layer t_translation::string_to_layer_ ( const std::string &  str)
static

Converts a string to a layer.

Parameters
strThe terrain string to convert, but needs to be sanitized so no spaces and only the terrain to convert.
Returns
The converted layer.

Definition at line 74 of file translation.cpp.

References string_to_layer_().

◆ string_to_layer_() [2/2]

static ter_layer t_translation::string_to_layer_ ( std::string_view  str)
static

Definition at line 704 of file translation.cpp.

References c, i, and NO_LAYER.

Referenced by string_to_layer_(), and string_to_number_().

◆ string_to_number_() [1/2]

static terrain_code t_translation::string_to_number_ ( std::string_view  str,
const ter_layer  filler = NO_LAYER 
)
static

Definition at line 734 of file translation.cpp.

References dummy, and string_to_number_().

◆ string_to_number_() [2/2]

static terrain_code t_translation::string_to_number_ ( std::string_view  str,
std::vector< std::string > &  start_positions,
const ter_layer  filler 
)
static

Converts a terrain string to a number.

Parameters
strThe terrain string with an optional number.
start_positionsReturns the start_positions, the caller should set it on -1 and it's only changed it there is a starting position found.
fillerIf the terrain has only 1 layer then the filler will be used as the second layer.
Returns
The terrain code found in the string if no valid terrain is found VOID will be returned.

Definition at line 739 of file translation.cpp.

References t_translation::terrain_code::base, NO_LAYER, NOT, t_translation::terrain_code::overlay, STAR, string_to_layer_(), utils::trim(), and WILDCARD.

Referenced by read_game_map(), read_list(), read_terrain_code(), and string_to_number_().

◆ terrain_matches() [1/3]

bool t_translation::terrain_matches ( const terrain_code src,
const ter_list dest 
)

Tests whether a specific terrain matches a list of expressions.

The list can use wildcard matching with *. It also has an inversion function. When a ! is found the result of the match is inverted. The matching stops at the first match (regardless of the ! found) the data is match from start to end.

Example: Ww, W* does match and returns true Ww, {!, W*} does match and returns false (due to the !) WW, Ww doesn't match and return false

Multilayer rules: If a terrain has multiple layers, each layer will be matched separately, returning true only if both layers match.

Example: A*^* matches Abcd but also Abcd^Abcd A*^ matches Abcd but not Abcd^Abcd A*^Abcd does not match Abcd but matches Abcd^Abcd

Note: If an expression doesn't specify a second layer (i.e. it contains no caret) the second layer will be filled in with a default value (See read_terrain_code and read_list).

In the terrain building code, the second layer will default to the wildcard, so both A* and A*^* will match Abcd^Abcd

Parameters
srcthe value to match (may not contain wildcards)
destthe list of expressions to match against
Returns
the result of the match (depending on the !'s)

Definition at line 424 of file translation.cpp.

References t_translation::terrain_code::base, get_mask_(), has_wildcard(), NOT, t_translation::terrain_code::overlay, PLAIN_LOG, src, and STAR.

◆ terrain_matches() [2/3]

bool t_translation::terrain_matches ( const terrain_code src,
const ter_match dest 
)

Tests whether a certain terrain matches a list of expressions, for matching rules see above.

The matching requires some bit mask which impose a certain overhead. This version uses a cache to cache the masks so if a list needs to be matched often this version is preferred.

Parameters
srcthe value to match (may not contain wildcards)
destthe cached list of expressions to match against
Returns
the result of the match (depending on the !'s)

Definition at line 507 of file translation.cpp.

References t_translation::ter_match::has_wildcard, i, t_translation::ter_match::is_empty, t_translation::ter_match::mask, t_translation::ter_match::masked_terrain, NOT, src, STAR, and t_translation::ter_match::terrain.

◆ terrain_matches() [3/3]

bool t_translation::terrain_matches ( const terrain_code src,
const terrain_code dest 
)

Tests whether a specific terrain matches an expression, for matching rules see above.

Parameters
srcthe value to match (may not contain wildcards)
destthe expression to match against
Returns
the result of the match (depending on the !'s)

Definition at line 419 of file translation.cpp.

References src.

Referenced by default_map_generator_job::default_generate_map(), flood_name(), gui2::get_mp_tooltip(), terrain_filter::match_internal(), unit_animation::matches(), help::unit_topic_generator::operator()(), gamemap_base::overlay(), REPORT_GENERATOR(), terrain_builder::terrain_matches(), and unit_moves().

◆ write_game_map()

std::string t_translation::write_game_map ( const ter_map map,
const starting_positions positions = starting_positions(),
coordinate  border_offset = coordinate{ 0, 0 } 
)

Write a gamemap in to a vector string.

Parameters
mapA terrain vector, as returned from read_game_map
positionsA starting positions map, as returned from read_game_map
border_offset
Returns
A terrain string which can be read with read_game_map. For readability the map is padded to groups of 12 chars, followed by a comma and space.

Definition at line 389 of file translation.cpp.

References t_translation::ter_map::h, number_to_string_(), t_translation::ter_map::w, map_location::x, and map_location::y.

Referenced by cave_map_generator::cave_map_generator_job::cave_map_generator_job(), output_map(), gamemap_base::to_string(), and gamemap::write().

◆ write_list()

std::string t_translation::write_list ( const ter_list list)

Writes a list of terrains to a string, only writes the new format.

Parameters
listA vector with one or more terrain codes
Returns
A string with the terrain codes, comma separated and a space behind the commas. Not padded.

Definition at line 251 of file translation.cpp.

References number_to_string_().

Referenced by terrain_builder::parse_config(), and prefs::~prefs().

◆ write_terrain_code()

std::string t_translation::write_terrain_code ( const terrain_code tcode)

Writes a single terrain code to a string.

The writers only support the new format.

Parameters
tcodeThe terrain code to convert to a string
Returns
A string containing the terrain code

Definition at line 212 of file translation.cpp.

References number_to_string_().

Referenced by terrain_builder::add_off_map_rule(), movetype::terrain_info::data::calc_value(), default_map_generator_job::default_generate_map(), game_lua_kernel::impl_get_terrain_list(), luaW_push_terrain(), operator<<(), terrain_builder::parse_mapstring(), place_village(), gamemap::read(), terrain_type::terrain_type(), and gamemap::write_terrain().

Variable Documentation

◆ ALL_FORESTS

const ter_match t_translation::ALL_FORESTS
extern

◆ ALL_HILLS

const ter_match t_translation::ALL_HILLS ( "!  ,
*^V *  ,
,
H *"   
)

Definition at line 159 of file translation.hpp.

◆ ALL_MOUNTAINS

const ter_match t_translation::ALL_MOUNTAINS ( "!  ,
*^V *  ,
,
M *"   
)

Definition at line 160 of file translation.hpp.

Referenced by default_map_generator_job::default_generate_map().

◆ ALL_OFF_MAP

const ter_match t_translation::ALL_OFF_MAP
extern

◆ ALL_SWAMPS

const ter_match t_translation::ALL_SWAMPS ( "!  ,
*^V *  ,
*^B *  ,
,
S *"   
)

Definition at line 161 of file translation.hpp.

Referenced by default_map_generator_job::default_generate_map().

◆ BASE

const terrain_code t_translation::BASE = string_to_number_("_bas")

Definition at line 148 of file translation.cpp.

Referenced by merge_alias_lists(), and help::print_behavior_description().

◆ CAVE

const terrain_code t_translation::CAVE = string_to_number_("Uu")

Definition at line 139 of file translation.cpp.

◆ CAVE_WALL

const terrain_code t_translation::CAVE_WALL = string_to_number_("Xu")

Definition at line 138 of file translation.cpp.

◆ DEEP_WATER

const terrain_code t_translation::DEEP_WATER = string_to_number_("Wo")

Definition at line 132 of file translation.cpp.

Referenced by default_map_generator_job::generate_river_internal().

◆ DWARVEN_CASTLE

const terrain_code t_translation::DWARVEN_CASTLE = string_to_number_("Cud")

Definition at line 141 of file translation.cpp.

◆ DWARVEN_KEEP

const terrain_code t_translation::DWARVEN_KEEP = string_to_number_("Kud")

Definition at line 142 of file translation.cpp.

◆ FOGGED

const terrain_code t_translation::FOGGED = string_to_number_("_f")

◆ FOREST

const terrain_code t_translation::FOREST = string_to_number_("Gg^Ff")

Definition at line 134 of file translation.cpp.

Referenced by default_map_generator_job::default_generate_map().

◆ GRASS_LAND

const terrain_code t_translation::GRASS_LAND = string_to_number_("Gg")

Definition at line 133 of file translation.cpp.

Referenced by default_map_generator_job::default_generate_map().

◆ HILL

const terrain_code t_translation::HILL = string_to_number_("Hh")

Definition at line 136 of file translation.cpp.

Referenced by default_map_generator_job::default_generate_map().

◆ HUMAN_CASTLE

const terrain_code t_translation::HUMAN_CASTLE = string_to_number_("Ch")

Definition at line 129 of file translation.cpp.

Referenced by default_map_generator_job::default_generate_map().

◆ HUMAN_KEEP

const terrain_code t_translation::HUMAN_KEEP = string_to_number_("Kh")

Definition at line 130 of file translation.cpp.

Referenced by default_map_generator_job::default_generate_map().

◆ MINUS

const terrain_code t_translation::MINUS = string_to_number_("-")

◆ MOUNTAIN

const terrain_code t_translation::MOUNTAIN = string_to_number_("Mm")

Definition at line 135 of file translation.cpp.

Referenced by default_map_generator_job::default_generate_map().

◆ NO_LAYER

const ter_layer t_translation::NO_LAYER = 0xFFFFFFFF

◆ NONE_TERRAIN

const terrain_code t_translation::NONE_TERRAIN = terrain_code()

◆ NOT

const terrain_code t_translation::NOT = string_to_number_("!")

Definition at line 146 of file translation.cpp.

Referenced by string_to_number_(), and terrain_matches().

◆ OFF_MAP_USER

const terrain_code t_translation::OFF_MAP_USER = string_to_number_("_off^_usr")

Definition at line 119 of file translation.cpp.

Referenced by terrain_builder::add_off_map_rule().

◆ PLUS

const terrain_code t_translation::PLUS = string_to_number_("+")

◆ SHALLOW_WATER

const terrain_code t_translation::SHALLOW_WATER = string_to_number_("Ww")

◆ STAR

const terrain_code t_translation::STAR = string_to_number_("*")

◆ TB_DOT

const ter_layer t_translation::TB_DOT = '.' << 24

Definition at line 348 of file translation.hpp.

Referenced by terrain_builder::parse_mapstring(), and read_builder_map().

◆ TB_STAR

const ter_layer t_translation::TB_STAR = '*' << 24

Definition at line 347 of file translation.hpp.

Referenced by terrain_builder::parse_mapstring().

◆ UNDERGROUND_VILLAGE

const terrain_code t_translation::UNDERGROUND_VILLAGE = string_to_number_("Uu^Vu")

Definition at line 140 of file translation.cpp.

◆ VOID_TERRAIN

const terrain_code t_translation::VOID_TERRAIN = string_to_number_("_s")

VOID_TERRAIN is used for shrouded hexes.

It's also used by terrain_type's default constructor, but that's only used as the sentinel value for when terrain_type_data::get_terrain_info() is asked for an unknown terrain code.

Definition at line 126 of file translation.cpp.

Referenced by gui2::get_mp_tooltip(), terrain_type::is_nonnull(), editor::is_valid_terrain(), help::unit_topic_generator::operator()(), gamemap_base::overlay(), image::prep_minimap_for_rendering(), and unit_moves().

◆ WILDCARD

const ter_layer t_translation::WILDCARD = 0x2A000000

Definition at line 39 of file translation.hpp.

Referenced by terrain_builder::add_constraints(), and string_to_number_().