forked from jogp10/GongasMaze
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMaze.cpp
57 lines (48 loc) · 913 Bytes
/
Maze.cpp
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
//T02_G11
#include "Maze.h"
void Maze::setCols(unsigned int numCols)
{
this->numCols = numCols;
}
void Maze::setRows(unsigned int numRows)
{
this->numRows = numRows;
}
bool Maze::checkPost(const Post& post) const
{
for(auto i : posts)
{
if(post.getRow() == i.getRow()&& post.getCol() == i.getCol() && post.getElectric() == i.getElectric())
{
return true;
}
}
return false;
}
bool Maze::checkExit(const Exit& exit) const
{
for(auto i : exits)
{
if(exit.O_row == i.O_row && exit.O_col == i.O_col)
{
return true;
}
}
return false;
}
void Maze::addPost(const Post& post)
{
posts.push_back(post);
}
void Maze::addExit(const Exit& exit)
{
exits.push_back(exit);
}
unsigned int Maze::getnumRows() const
{
return numRows;
}
unsigned int Maze::getnumCols() const
{
return numCols;
}