17 #ifndef TERRAIN_TRANSLATION_H_INCLUDED
18 #define TERRAIN_TRANSLATION_H_INCLUDED
23 #include <boost/bimap.hpp>
24 #include <boost/bimap/set_of.hpp>
25 #include <boost/bimap/multiset_of.hpp>
75 typedef std::vector<t_terrain>
t_list;
76 typedef std::vector<std::vector<t_terrain> >
t_map;
103 return l.
x < r.
x || (l.
x == r.
x && l.
y < r.
y);
119 extern const t_terrain
FOGGED;
129 extern const t_terrain
FOREST;
131 extern const t_terrain
HILL;
134 extern const t_terrain
CAVE;
139 extern const t_terrain
PLUS;
140 extern const t_terrain
MINUS;
141 extern const t_terrain
NOT;
142 extern const t_terrain
STAR;
143 extern const t_terrain
BASE;
205 using tstarting_positions = boost::bimaps::bimap<boost::bimaps::set_of<std::string>, boost::bimaps::multiset_of<coordinate>>;
Contains an x and y coordinate used for starting positions in maps.
tformula< unsigned > x_
The x coordinate of the rectangle.
boost::bimaps::bimap< boost::bimaps::set_of< std::string >, boost::bimaps::multiset_of< coordinate >> tstarting_positions
const t_terrain UNDERGROUND_VILLAGE
t_list read_list(const std::string &str, const t_layer filler)
Reads a list of terrains from a string, when reading the.
std::string write_game_map(const t_map &map, const tstarting_positions &starting_positions, coordinate border_offset)
Write a gamemap in to a vector string.
size_t max_map_size()
Return the maximum allowed map size (in either dimension), the maximum map area is, therefore, this value squared.
error(const std::string &message)
const t_terrain NONE_TERRAIN
std::ostream & operator<<(std::ostream &s, const t_terrain &a)
t_map read_game_map(const std::string &str, tstarting_positions &starting_positions, coordinate border_offset)
Reads a gamemap string into a 2D vector.
bool has_wildcard(const t_terrain &tcode)
Tests whether a terrain code contains a wildcard.
const t_terrain DEEP_WATER
const t_terrain OFF_MAP_USER
t_terrain read_terrain_code(const std::string &str, const t_layer filler)
Reads a single terrain from a string.
const t_terrain HUMAN_KEEP
GLdouble GLdouble GLdouble b
std::vector< std::vector< t_terrain > > t_map
const t_terrain GRASS_LAND
const t_match ALL_FORESTS
std::string write_list(const t_list &list)
Writes a list of terrains to a string, only writes the new format.
This structure can be used for matching terrain strings.
GLboolean GLboolean GLboolean GLboolean a
const t_terrain DWARVEN_CASTLE
bool operator!=(const t_terrain &a, const t_terrain &b)
A terrain string which is converted to a terrain is a string with 1 or 2 layers the layers are separa...
const t_terrain HUMAN_CASTLE
t_terrain operator&(const t_terrain &a, const t_terrain &b)
const t_match ALL_MOUNTAINS("!,*^V*,!,M*")
t_terrain(t_layer b, t_layer o)
const t_terrain CAVE_WALL
bool operator==(const t_terrain &a, const t_terrain &b)
bool terrain_matches(const t_terrain &src, const t_terrain &dest)
Tests whether a specific terrain matches an expression, for matching rules see above.
t_terrain operator|(const t_terrain &a, const t_terrain &b)
tformula< unsigned > y_
The y coordinate of the rectangle.
friend bool operator<(const coordinate &l, const coordinate &r)
GLdouble GLdouble GLdouble r
const t_terrain DWARVEN_KEEP
std::string write_terrain_code(const t_terrain &tcode)
Writes a single terrain code to a string.
const t_terrain VOID_TERRAIN
Base class for all the errors encountered by the engine.
bool operator<(const t_terrain &a, const t_terrain &b)
const t_match ALL_SWAMPS("!,*^V*,*^B*,!,S*")
GLsizei GLenum GLuint GLuint GLsizei char * message
const t_terrain SHALLOW_WATER
GLsizei const GLcharARB ** string
t_map read_builder_map(const std::string &str)
Reads a builder map.
const t_match ALL_HILLS("!,*^V*,!,H*")
std::vector< t_terrain > t_list