Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | List of all members
LabyrinthMap Class Reference

Class contains complete information about the labyrinth structure. More...

#include <map.h>

Public Member Functions

 LabyrinthMap ()
 Constructor. More...
 
 ~LabyrinthMap ()
 Deconstructor. More...
 
void setWall (int x, int y, PosType pos, bool state)
 Set or remove a wall. More...
 
bool getWall (int x, int y, PosType pos)
 Check if the wall exists. More...
 
void setDebug (int level)
 
string toString ()
 Return the serialized map as string. More...
 
bool fromString (string map_str)
 Read the map from a string. More...
 
bool save ()
 Save the map to ~/.laustracker/map.txt. More...
 
bool load ()
 Load the map from ~/.laustracker/map.txt. More...
 

Public Attributes

field_t fields [8][8]
 Contains data about every field. More...
 
string map_path
 File to save or load the map. More...
 

Private Member Functions

void set_single_wall (int x, int y, PosType pos, bool state)
 
void init_map ()
 

Private Attributes

int debuglevel
 
bool test
 

Detailed Description

Class contains complete information about the labyrinth structure.

Definition at line 64 of file map.h.

Constructor & Destructor Documentation

LabyrinthMap::LabyrinthMap ( )

Constructor.

Initialization of the map.

LabyrinthMap::~LabyrinthMap ( )

Deconstructor.

Free memory.

Member Function Documentation

bool LabyrinthMap::fromString ( string  map_str)

Read the map from a string.

Parameters
map_strString that contains a map.
Returns
true, if a map was found.
bool LabyrinthMap::getWall ( int  x,
int  y,
PosType  pos 
)

Check if the wall exists.

Parameters
xx-coordinate
yy-coordinate
posPosition within a field (top, bottom, left, right, center, other)
Returns
true or false, true if the wall exists
bool LabyrinthMap::load ( )

Load the map from ~/.laustracker/map.txt.

Returns
true, if the map was loaded.
bool LabyrinthMap::save ( )

Save the map to ~/.laustracker/map.txt.

Returns
true, if the map could be saved.
void LabyrinthMap::setWall ( int  x,
int  y,
PosType  pos,
bool  state 
)

Set or remove a wall.

Parameters
xx-coordinate
yy-coordinate
posPosition within a field (top, bottom, left, right, center, other)
statetrue: wall exists false: wall does not exist
string LabyrinthMap::toString ( )

Return the serialized map as string.

Returns
Serialized map.

Member Data Documentation

field_t LabyrinthMap::fields[8][8]

Contains data about every field.

Definition at line 77 of file map.h.

string LabyrinthMap::map_path

File to save or load the map.

Definition at line 80 of file map.h.


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