#include <lua_terrainmap.hpp>
Public Member Functions | |
mapgen_gamemap (std::string_view data) | |
mapgen_gamemap (int w, int h, terrain_code) | |
void | set_terrain (const map_location &loc, const terrain_code &terrain, const terrain_type_data::merge_mode mode=terrain_type_data::BOTH, bool replace_if_failed=false) override |
Clobbers over the terrain at location 'loc', with the given terrain. More... | |
template<typename F > | |
void | for_each_loc (const F &f) const |
Public Member Functions inherited from gamemap_base | |
virtual | ~gamemap_base () |
std::string | to_string () const |
int | w () const |
Effective map width. More... | |
int | h () const |
Effective map height. More... | |
int | border_size () const |
Size of the map border. More... | |
int | total_width () const |
Real width of the map, including borders. More... | |
int | total_height () const |
Real height of the map, including borders. More... | |
bool | empty () const |
Tell if the map is of 0 size. More... | |
bool | on_board (const map_location &loc) const |
Tell if a location is on the map. More... | |
bool | on_board_with_border (const map_location &loc) const |
terrain_code | get_terrain (const map_location &loc) const |
Looks up terrain at a particular location. More... | |
location_map & | special_locations () |
const location_map & | special_locations () const |
const std::vector< map_location > | starting_positions () const |
void | set_special_location (const std::string &id, const map_location &loc) |
map_location | special_location (const std::string &id) const |
void | set_starting_position (int side, const map_location &loc) |
Manipulate starting positions of the different sides. More... | |
map_location | starting_position (int side) const |
int | num_valid_starting_positions () const |
Counts the number of sides that have valid starting positions on this map. More... | |
int | is_starting_position (const map_location &loc) const |
returns the side number of the side starting at position loc, 0 if no such side exists. More... | |
const std::string * | is_special_location (const map_location &loc) const |
returns the name of the special location at position loc, null if no such location exists. More... | |
std::vector< map_location > | parse_location_range (const std::string &xvals, const std::string &yvals, bool with_border=false) const |
Parses ranges of locations into a vector of locations, using this map's dimensions as bounds. More... | |
void | overlay (const gamemap_base &m, map_location loc, const std::vector< overlay_rule > &rules=std::vector< overlay_rule >(), bool is_odd=false, bool ignore_special_locations=false) |
Overlays another map onto this one at the given position. More... | |
template<typename F > | |
void | for_each_loc (const F &f) const |
template<typename F > | |
void | for_each_walkable_loc (const F &f) const |
Additional Inherited Members | |
Public Types inherited from gamemap_base | |
using | terrain_code = t_translation::terrain_code |
using | terrain_map = t_translation::ter_map |
using | location_map = t_translation::starting_positions |
Static Public Attributes inherited from gamemap_base | |
static const int | default_border = 1 |
The default border style for a map. More... | |
static const int | MAX_PLAYERS = 9 |
Maximum number of players supported. More... | |
Protected Member Functions inherited from gamemap_base | |
gamemap_base ()=default | |
gamemap_base (int w, int h, terrain_code default_ter=terrain_code()) | |
terrain_map & | tiles () |
const terrain_map & | tiles () const |
Definition at line 26 of file lua_terrainmap.hpp.
|
explicit |
Definition at line 103 of file lua_terrainmap.cpp.
References t_translation::read_game_map(), s, gamemap_base::special_locations(), and gamemap_base::tiles().
mapgen_gamemap::mapgen_gamemap | ( | int | w, |
int | h, | ||
terrain_code | t | ||
) |
Definition at line 113 of file lua_terrainmap.cpp.
|
inline |
Definition at line 33 of file lua_terrainmap.hpp.
References f, gamemap_base::total_height(), and gamemap_base::total_width().
|
overridevirtual |
Clobbers over the terrain at location 'loc', with the given terrain.
Uses mode and replace_if_failed like merge_terrains().
Implements gamemap_base.
Definition at line 137 of file lua_terrainmap.cpp.
References gamemap_base::border_size(), t_translation::ter_map::get(), gamemap_base::get_terrain(), simplemerge(), t, gamemap_base::tiles(), map_location::x, and map_location::y.