#ifndef MAZE_H
#define MAZE_H

#include "hexagon.h"
#include "image.h"


struct coordinate
{
  int x;
  int y;
};

class Maze
{
public:
  // CONSTRUCTOR
  Maze(int width, int height, int size);

  // DESTRUCTOR
  ~Maze();

  // METHODS
  void constructMaze();
  void getApproximativeSizeForImage(int& width, int& height) const;
  void display(SDL_Surface* image) const;
private:
  // FIELDS
  Hexagon **maze;
  int width;
  int height;
  int size;

  // METHODS
  bool asUnvisitedNeighbours(int x, int y) const;
  int numberOfUnvisitedNeighbours(int x, int y) const;
  void pickRandomUnvisitedNeighbour(int x, int y, int* x_temp, int* y_temp) const;
  bool inBounds(int x, int y) const;
  void removeWall(int x1, int y1, int x2, int y2);
  bool unvisitedCell() const;
  int getNeighbourX(int x, int y, direction dir) const;
  int getNeighbourY(int x, int y, direction dir) const;
};

#endif
