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 413 of file builder.hpp.
| terrain_builder::tilemap::tilemap | ( | int | x, |
| int | y | ||
| ) |
Constructs a tilemap of dimensions x * y.
Definition at line 187 of file builder.cpp.
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 210 of file builder.cpp.
References loc, map_location::x, and map_location::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 219 of file builder.cpp.
References loc, map_location::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 226 of file builder.cpp.
References loc, map_location::x, and map_location::y.
| void terrain_builder::tilemap::reload | ( | int | x, |
| int | y | ||
| ) |
Rebuilds the map to a new set of dimensions.
Definition at line 201 of file builder.cpp.
Referenced by terrain_builder::reload_map().
| void terrain_builder::tilemap::reset | ( | ) |
Resets the whole tile map.
Definition at line 195 of file builder.cpp.
Referenced by terrain_builder::rebuild_all(), and tilemap().
|
private |
The map.
Definition at line 457 of file builder.hpp.
|
private |
The x dimension of the map.
Definition at line 459 of file builder.hpp.
|
private |
The y dimension of the map.
Definition at line 461 of file builder.hpp.