// Computer Science 367, Section 3, Fall 1997
// Instructor: Michael Siff (siff@cs.wisc.edu)
//
// Programming Assignment Two
//
//
// FILE: maze.h
//
//
// CLASS PROVIDED: Mazer - class representing the maze in the aMAZEd game.
//
// 
// CONSTANT MEMBERS for the Maze class:
//   const int MAX_MAZE_Y
//   const int MAX_MAZE_X
//     The maximum height and width of the maze.
//
// CONSTRUCTOR for the Maze class:
//   Maze(const char *filename)
//     Precondition: filename is a valid filename for a file representing a
//     maze.
//     Postcondition: a maze object has been created according to the data
//     stored in the file indicated by filename.
//
// CONSTANT MEMBER FUNCTIONS for the Maze class:
//   void display() const 
//     Precondition: the screen window has been intialized properly.
//     Postcondition: the maze has been drawn in the screen window.
//   void displayNeighbors(int y, int x) const 
//     Precondition: the screen window has been initialized properly.
//     Postcondition: the contents of the maze one unit in each direction
//     surrounding the coordinates (y,x) has been displayed.
//   void findStart(int &y, int &x) const
//     Precondition: the maze has a unique start symbol
//     Postcondition: (y,x) now contain the coordinates of the start symbol.
//   bool isExit(int y, int x) const
//     Precondition: (y,x) are valid coordinates in the maze.
//     Postcondition: true iff there is an exit at (y,x).
//   bool isValidDirection(int y, int x, direction d) const;
//     Precondition: (y,x) are valid coordinates in the maze.
//     Postcondition: true iff coordinates that are (y,x) adjusted by the
//     direction d are valid in the maze and there is not a wall at that
//     location.


#ifndef MAZE_H
#define MAZE_H

#include "direction.h"

class Maze {
public:
  static const int MAX_MAZE_X = 70;
  static const int MAX_MAZE_Y = 50;
  Maze(const char *filename);
  void display() const;
  void displayNeighbors(int y, int x) const;
  void findStart(int &y, int &x) const;
  bool isExit(int y, int x) const;
  bool isValidDirection(int y, int x, direction d) const;
private:
  enum maze_element {SPACE,WALL,START,EXIT};
  maze_element M[MAX_MAZE_Y+1][MAX_MAZE_X+1];
  void displayCell(int y, int x) const;
};


#endif
