36#if !defined(LIBCOYOTL_MAZE_H)
37#define LIBCOYOTL_MAZE_H
A STL-compatible array class.
Definition array.h:73
Defines the data structure of a maze.
Definition maze.h:56
position get_exit_cell_position() const
Get the exit cell position.
Definition maze.h:252
void read(std::istream &a_source)
Utility method to read a maze.
size_t get_width() const
Return the width of the maze.
Definition maze.h:222
position get_entrance_cell_position() const
Get the entrance cell position.
Definition maze.h:242
void deep_copy(const maze &a_source)
Deep copy utility.
direction
Wall identifiers for the four cardinal directions.
Definition maze.h:68
@ DIR_WEST
South (down)
Definition maze.h:72
@ DIR_EAST
North (up)
Definition maze.h:70
@ DIR_SOUTH
East (right)
Definition maze.h:71
maze(size_t a_width, size_t a_height)
Constructor without an architect (for use by load)
maze(const maze &a_source)
Copy constructor.
size_t m_height
Height of the maze in cells.
Definition maze.h:309
static maze generate(size_t a_width, size_t a_height, architect &a_architect)
Constructor.
static maze load(std::istream &a_source)
A "named constructor" to load a maze from an istream.
position m_entrance
Position of the entrance cell.
Definition maze.h:312
void construct()
Allocates memory and sets intial values for a maze.
void save(std::ostream &a_receiver)
Store a maze to a stream.
maze & operator=(const maze &a_source)
Assignment operator.
position m_exit
Position of the exit cell.
Definition maze.h:315
cell ** m_cells
The cell data.
Definition maze.h:318
void release()
Utility method to delete all data buffers.
virtual ~maze()
Destructor.
size_t m_width
Width of the maze in cells.
Definition maze.h:306
size_t get_height() const
Return the height of the maze.
Definition maze.h:232
cell get_cell(size_t a_col, size_t a_row) const
Get cell data.
wall
The state of a wall.
Definition maze.h:60
@ WALL_CLOSED
Wall is open
Definition maze.h:62
@ WALL_SOLID
Wall is closed
Definition maze.h:63
A row-column position in the maze.
Definition maze.h:80
size_t m_col
Column coordinate.
Definition maze.h:85
size_t m_row
Row coordinate.
Definition maze.h:82
A cell in a 2D maze grid.
Definition maze.h:95
cell(const cell &a_source)
Copy constructor.
cell & operator=(const cell &a_source)
Assignment operator.
wall * m_walls[4]
Pointers to four walls, indexed by wall values.
Definition maze.h:97
virtual ~cell()
Destructor.
Pluggable object to randomize a maze.
Definition maze.h:140
static cell ** get_cells(maze &a_target)
Get cell map for a maze.
Definition maze.h:158
virtual void create_floor_plan(maze &a_target)=0
Creates a floor plan for a maze.