36 #if !defined(LIBCOYOTL_MAZE_H) 37 #define LIBCOYOTL_MAZE_H 148 virtual void create_floor_plan(
maze & a_target) = 0;
186 static maze load(std::istream & a_source);
215 void save(std::ostream & a_receiver);
275 maze(
size_t a_width,
size_t a_height);
302 void read(std::istream & a_source);
void release()
Utility method to delete all data buffers.
Wall is open
Definition: maze.h:62
size_t get_height() const
Return the height of the maze.
Definition: maze.h:232
A row-column position in the maze.
Definition: maze.h:79
size_t m_row
Row coordinate.
Definition: maze.h:82
A cell in a 2D maze grid.
Definition: maze.h:94
Pluggable object to randomize a maze.
Definition: maze.h:139
direction
Wall identifiers for the four cardinal directions.
Definition: maze.h:67
size_t m_width
Width of the maze in cells.
Definition: maze.h:306
position get_entrance_cell_position() const
Get the entrance cell position.
Definition: maze.h:242
maze & operator=(const maze &a_source)
Assignment operator.
Defines the data structure of a maze.
Definition: maze.h:55
static cell ** get_cells(maze &a_target)
Get cell map for a maze.
Definition: maze.h:158
size_t m_col
Column coordinate.
Definition: maze.h:85
void read(std::istream &a_source)
Utility method to read a maze.
virtual ~maze()
Destructor.
static maze generate(size_t a_width, size_t a_height, architect &a_architect)
Constructor.
void deep_copy(const maze &a_source)
Deep copy utility.
wall
The state of a wall.
Definition: maze.h:59
Wall is closed
Definition: maze.h:63
South (down)
Definition: maze.h:72
void construct()
Allocates memory and sets intial values for a maze.
size_t m_height
Height of the maze in cells.
Definition: maze.h:309
void save(std::ostream &a_receiver)
Store a maze to a stream.
maze(const maze &a_source)
Copy constructor.
size_t get_width() const
Return the width of the maze.
Definition: maze.h:222
position get_exit_cell_position() const
Get the exit cell position.
Definition: maze.h:252
cell ** m_cells
The cell data.
Definition: maze.h:318
North (up)
Definition: maze.h:70
East (right)
Definition: maze.h:71
position m_entrance
Position of the entrance cell.
Definition: maze.h:312
cell get_cell(size_t a_col, size_t a_row) const
Get cell data.
static maze load(std::istream &a_source)
A "named constructor" to load a maze from an istream.
position m_exit
Position of the exit cell.
Definition: maze.h:315