terrain_builder::tilemap Class Reference

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

List of all members.

Public Member Functions

 tilemap (int x, int y)
 Constructs a tilemap of dimensions x * y.
tileoperator[] (const gamemap::location &loc)
 Returns a reference to the tile which is at the position pointed by loc.
const tileoperator[] (const gamemap::location &loc) const
 a const variant of operator[]
bool on_map (const gamemap::location &loc) const
 Tests if a location is on the map.
void reset ()
 Resets the whole tile map.

Private Attributes

std::vector< tilemap_
 The map.
int x_
 The x dimension of the map.
int y_
 The y dimension of the map.


Detailed Description

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

Definition at line 342 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 348 of file builder.hpp.


Member Function Documentation

terrain_builder::tile & terrain_builder::tilemap::operator[] ( const gamemap::location loc  ) 

Returns a reference to the tile which is at the position pointed by loc.

The location MUST be on the map!

Parameters:
loc The location of the tile
Returns:
A reference to the tile at this location.

Definition at line 131 of file builder.cpp.

References map_, on_map(), gamemap::location::x, x_, and gamemap::location::y.

const terrain_builder::tile & terrain_builder::tilemap::operator[] ( const gamemap::location loc  )  const

a const variant of operator[]

Definition at line 138 of file builder.cpp.

References map_, on_map(), gamemap::location::x, x_, and gamemap::location::y.

bool terrain_builder::tilemap::on_map ( const gamemap::location loc  )  const

Tests if a location is on the map.

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

Definition at line 121 of file builder.cpp.

References gamemap::location::x, x_, gamemap::location::y, and y_.

Referenced by terrain_builder::apply_rule(), terrain_builder::get_terrain_at(), operator[](), terrain_builder::rebuild_terrain(), terrain_builder::rule_matches(), and terrain_builder::update_animation().

void terrain_builder::tilemap::reset (  ) 

Resets the whole tile map.

Definition at line 115 of file builder.cpp.

References map_.

Referenced by terrain_builder::rebuild_all().


Member Data Documentation

std::vector<tile> terrain_builder::tilemap::map_ [private]

The map.

Definition at line 384 of file builder.hpp.

Referenced by operator[](), and reset().

The x dimension of the map.

Definition at line 386 of file builder.hpp.

Referenced by on_map(), and operator[]().

The y dimension of the map.

Definition at line 388 of file builder.hpp.

Referenced by on_map().


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

Generated by doxygen 1.5.5 on 23 May 2008 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs