-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmaze.h
53 lines (46 loc) · 917 Bytes
/
maze.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#ifndef _MAZE_H_
#define _MAZE_H_
#include <iostream>
#include <stdio.h>
#include <stack.h>
#include <stack>
#include <map>
#include <cell.h>
namespace amo {
typedef enum {AVAL, ROUTE, BACK, WALL} STATUS;
typedef enum {INIT, EAST, SOUTH, WEST, NORTH, DEAD} DIRECTION;
class Cell;
/**
* Enclosing class
*/
class Maze {
public:
/**
* Nested class
*/
class Inner {
private:
public:
Inner();
~Inner();
friend class Maze;
};
static Maze& getInstance(int n, int m);
void traverse(std::vector<Cell*>& vector);
void traverse(std::stack<Cell*>& stack);
bool labyrinth(int sx, int sy, int tx, int ty);
Cell* pry(Cell& c);
void probe(Cell** c);
int next_available(Cell& c);
private:
static Maze* instance;
//static std::stack<amo::Cell> path;
Maze(int i, int j);
~Maze();
int row;
int col;
Cell **mz;
friend class Inner;
};
};
#endif