The map of "tile" structures corresponding to the level map. More...
Public Member Functions | |
tilemap (int x, int y) | |
Constructs a tilemap of dimensions x * y. More... | |
tile & | operator[] (const map_location &loc) |
Returns a reference to the tile which is at the position pointed by loc. More... | |
const tile & | operator[] (const map_location &loc) const |
a const variant of operator[] More... | |
bool | on_map (const map_location &loc) const |
Tests if a location is on the map. More... | |
void | reset () |
Resets the whole tile map. More... | |
void | reload (int x, int y) |
Rebuilds the map to a new set of dimensions. More... | |
Private Attributes | |
std::vector< tile > | tiles_ |
The map. More... | |
int | x_ |
The x dimension of the map. More... | |
int | y_ |
The y dimension of the map. More... | |
The map of "tile" structures corresponding to the level map.
Definition at line 427 of file builder.hpp.
Constructs a tilemap of dimensions x * y.
Definition at line 433 of file builder.hpp.
References reset().
bool terrain_builder::tilemap::on_map | ( | const map_location & | loc | ) | const |
Tests if a location is on the map.
loc | The location to test |
Definition at line 214 of file builder.cpp.
References map_location::x, x_, map_location::y, and y_.
Referenced by terrain_builder::apply_rule(), terrain_builder::get_terrain_at(), terrain_builder::get_tile(), terrain_builder::rebuild_terrain(), terrain_builder::rule_matches(), and terrain_builder::update_animation().
terrain_builder::tile & terrain_builder::tilemap::operator[] | ( | const map_location & | loc | ) |
Returns a reference to the tile which is at the position pointed by loc.
The location MUST be on the map!
loc | The location of the tile |
Definition at line 224 of file builder.cpp.
References map_location::x, x_, and map_location::y.
const terrain_builder::tile & terrain_builder::tilemap::operator[] | ( | const map_location & | loc | ) | const |
a const variant of operator[]
Definition at line 231 of file builder.cpp.
References map_location::x, x_, and map_location::y.
Rebuilds the map to a new set of dimensions.
Definition at line 205 of file builder.cpp.
Referenced by terrain_builder::reload_map().
void terrain_builder::tilemap::reset | ( | ) |
Resets the whole tile map.
Definition at line 199 of file builder.cpp.
Referenced by terrain_builder::rebuild_all(), and tilemap().
|
private |
The map.
Definition at line 474 of file builder.hpp.
|
private |
The x dimension of the map.
Definition at line 476 of file builder.hpp.
|
private |
The y dimension of the map.
Definition at line 478 of file builder.hpp.