-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMaze.hpp
60 lines (49 loc) · 929 Bytes
/
Maze.hpp
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
54
55
56
57
58
59
60
/*
* Maze.hpp
*
* Created on: Dec 5, 2017
* Author: dny
*/
#ifndef SRC_MAZE_HPP_
#define SRC_MAZE_HPP_
#include "Cube.hpp"
#include <GL/glut.h>
#include <list>
#include <iostream>
#include <list>
#include <vector>
#include <set>
#include <queue>
struct tile{
GLint x;
GLint y;
bool operator==(const tile& rhs) const{
return x == rhs.x && y==rhs.y;
}
};
class Maze {
public:
//Maze variables
GLint size;
tile start;
tile end;
//Maze containers
GLint **board;
GLint **visited;
//Search algorithm
queue<tile> tiles;
bool done;
tile agent;
std::list<Cube> cubes;
Maze();
Maze(GLint size);
void click(GLint x, GLint y, GLint width, GLint height);
GLint get(GLint x, GLint y);
void BFS();
void DFS();
void draw(GLint width, GLint height);
void draw3D();
void draw_2Dgrid();
void draw_3Dgrid();
};
#endif /* SRC_MAZE_HPP_ */