The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Member Functions | Private Attributes | List of all members
terrain_builder::tilemap Class Reference

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...
 
tileoperator[] (const map_location &loc)
 Returns a reference to the tile which is at the position pointed by loc. More...
 
const tileoperator[] (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< tiletiles_
 The map. More...
 
int x_
 The x dimension of the map. More...
 
int y_
 The y dimension of the map. More...
 

Detailed Description

The map of "tile" structures corresponding to the level map.

Definition at line 427 of file builder.hpp.

Constructor & Destructor Documentation

terrain_builder::tilemap::tilemap ( int  x,
int  y 
)
inline

Constructs a tilemap of dimensions x * y.

Definition at line 433 of file builder.hpp.

References reset().

Member Function Documentation

bool terrain_builder::tilemap::on_map ( const map_location loc) const

Tests if a location is on the map.

Parameters
locThe location to test
Returns
true if loc is on the map, false otherwise.

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!

Parameters
locThe location of the tile
Returns
A reference to the tile at this location.

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.

void terrain_builder::tilemap::reload ( int  x,
int  y 
)

Rebuilds the map to a new set of dimensions.

Definition at line 205 of file builder.cpp.

References x_, and y_.

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().

Member Data Documentation

std::vector<tile> terrain_builder::tilemap::tiles_
private

The map.

Definition at line 474 of file builder.hpp.

int terrain_builder::tilemap::x_
private

The x dimension of the map.

Definition at line 476 of file builder.hpp.

int terrain_builder::tilemap::y_
private

The y dimension of the map.

Definition at line 478 of file builder.hpp.


The documentation for this class was generated from the following files: