Map Class Reference

#include <Map.h>

List of all members.


Public Member Functions

 Map ()
 Public constructor.
virtual ~Map ()
 Virtual destructor.
void SetSize (int x, int y)
 Sets map size.
int GetWidth () const
 Gets map width.
int GetHeight () const
 Gets map height.
void Clear ()
 Clears map.
void FractalCreate (int maxlevel, int waterlevel)
 Creates map using fractals.
TileGetTile (int x, int y)
 Gets tile at given location.

Private Attributes

int m_Width
 Map width.
int m_Height
 Map height.
Tilem_pTile
 Pointer to array of tiles.

Detailed Description

(*** add brief description here ***)
Full Description
(*** add full description here ***)

Constructor & Destructor Documentation

Map (  ) 

Public constructor.

Full Description
This method creates an empty map. Initializes all member variables. The map is left in an empty state.
Returns:
New instance of class.

~Map (  )  [virtual]

Virtual destructor.

Full Description
This method destroys the map. Frees any memory allocated for the tiles.
Returns:
None.


Member Function Documentation

void SetSize ( int  width,
int  height 
)

Sets map size.

Full Description old tiles and allocates memory for new tiles. If the requested
width and height are not valid, the map is left in an empty state.
Returns:
None.
Parameters:
width  New map width.
height  New map height.

int GetWidth (  )  const [inline]

Gets map width.

int GetHeight (  )  const [inline]

Gets map height.

void Clear (  ) 

Clears map.

Full Description
This method clears the map. Clears all tiles on the map.
Returns:
None.

void FractalCreate ( int  range,
int  offset 
)

Creates map using fractals.

Full Description
This method creates a random map using two fractals. The first fractal is used as a tile height map and the second fractal is used as a tree density map.

The 'range' argument defines the maximum difference between highest and lowest tiles. Allows creation of maps with different vertical scales.

The 'offset' argument defines the amount that tiles are shifted downward. Negative tile levels are treated as water so this value controls the water level on the map.

Returns:
None.
Parameters:
range  Fractal height range.
offset  Downward fractal shift.

Tile * GetTile ( int  x,
int  y 
)

Gets tile at given location.

Full Description
This method gets a pointer to the tile at the specified array coodinate.
Returns:
Pointer to the spcified tile.
Parameters:
x  X coordinate of tile.
y  Y coordinate of tile.


Member Data Documentation

int m_Width [private]

Map width.

int m_Height [private]

Map height.

Tile* m_pTile [private]

Pointer to array of tiles.


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