The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Classes | Namespaces | Typedefs | Functions | Variables
translation.hpp File Reference
#include <vector>
#include <map>
#include <stdint.h>
#include <boost/bimap.hpp>
#include <boost/bimap/set_of.hpp>
#include <boost/bimap/multiset_of.hpp>
#include "exceptions.hpp"
Include dependency graph for translation.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  t_translation::t_terrain
 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  t_translation::t_match
 This structure can be used for matching terrain strings. More...
 
struct  t_translation::coordinate
 Contains an x and y coordinate used for starting positions in maps. More...
 
struct  t_translation::error
 

Namespaces

 t_translation
 

Typedefs

typedef uint32_t t_translation::t_layer
 
typedef std::vector< t_terrain > t_translation::t_list
 
typedef std::vector
< std::vector< t_terrain > > 
t_translation::t_map
 
using t_translation::tstarting_positions = boost::bimaps::bimap< boost::bimaps::set_of< std::string >, boost::bimaps::multiset_of< coordinate >>
 

Functions

size_t t_translation::max_map_size ()
 Return the maximum allowed map size (in either dimension), the maximum map area is, therefore, this value squared. More...
 
bool t_translation::operator< (const t_terrain &a, const t_terrain &b)
 
bool t_translation::operator== (const t_terrain &a, const t_terrain &b)
 
bool t_translation::operator!= (const t_terrain &a, const t_terrain &b)
 
t_terrain t_translation::operator& (const t_terrain &a, const t_terrain &b)
 
t_terrain t_translation::operator| (const t_terrain &a, const t_terrain &b)
 
t_terrain t_translation::read_terrain_code (const std::string &str, const t_layer filler=NO_LAYER)
 Reads a single terrain from a string. More...
 
std::string t_translation::write_terrain_code (const t_terrain &tcode)
 Writes a single terrain code to a string. More...
 
std::ostream & t_translation::operator<< (std::ostream &s, const t_terrain &a)
 
t_list t_translation::read_list (const std::string &str, const t_layer filler=NO_LAYER)
 Reads a list of terrains from a string, when reading the. More...
 
std::string t_translation::write_list (const t_list &list)
 Writes a list of terrains to a string, only writes the new format. More...
 
t_map t_translation::read_game_map (const std::string &str, tstarting_positions &starting_positions, coordinate border_offset=coordinate{0, 0})
 Reads a gamemap string into a 2D vector. More...
 
std::string t_translation::write_game_map (const t_map &map, const tstarting_positions &starting_positions=tstarting_positions(), coordinate border_offset=coordinate{0, 0})
 Write a gamemap in to a vector string. More...
 
bool t_translation::terrain_matches (const t_terrain &src, const t_list &dest)
 Tests whether a specific terrain matches a list of expressions. More...
 
bool t_translation::terrain_matches (const t_terrain &src, const t_terrain &dest)
 Tests whether a specific terrain matches an expression, for matching rules see above. More...
 
bool t_translation::terrain_matches (const t_terrain &src, const t_match &dest)
 Tests whether a certain terrain matches a list of expressions, for matching rules see above. More...
 
bool t_translation::has_wildcard (const t_terrain &tcode)
 Tests whether a terrain code contains a wildcard. More...
 
bool t_translation::has_wildcard (const t_list &list)
 Tests whether a terrain-code list contains at least one item with a wildcard. More...
 
t_map t_translation::read_builder_map (const std::string &str)
 Reads a builder map. More...
 

Variables

const t_layer t_translation::WILDCARD = 0x2A000000
 
const t_layer t_translation::NO_LAYER = 0xFFFFFFFF
 
const t_terrain t_translation::NONE_TERRAIN = t_terrain()
 
const t_match t_translation::ALL_FORESTS
 
const t_layer t_translation::TB_STAR = '*' << 24
 
const t_layer t_translation::TB_DOT = '.' << 24