-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMazeReader.h
73 lines (60 loc) · 1.31 KB
/
MazeReader.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/* @Author: Anna Fritz
* @File: MazeReader.h
* @Date: March 27, 2019
* @Brief: This is the implementation file for the MazeReader class
*/
#ifndef MAZEREADER_H
#define MAZEREADER_H
#include "MazeWalker.h"
#include "MazeCreationException.h"
#include <iostream>
#include <string>
#include <fstream>
using namespace std;
class MazeReader
{
public:
/**
* @post A MazeReader is created. A 2D char array is allocated with the maze information.
* @throws MazeCreationExecption
*
*/
MazeReader(string file);
/**
* @post The maze is deallocated.
*/
~MazeReader();
/**
* @pre the file was formatting and read in correctly
* @return Returns pointer to the maze
*/
char** getMaze() const;
/**
* @pre the file was formatted and read in correctly
* @returns the number of columns listed in the file
*/
int getCols() const;
/**
* @pre the file was formatted and read in correctly
* @returns the number of rows listed in the file
*/
int getRows() const;
/**
* @pre the file was formatted and read in correctly
* @returns the starting column
*/
int getStartCol() const;
/**
* @pre the file was formatted and read in correctly
* @returns the starting row
*/
int getStartRow() const;
private:
string m_filename;
int m_numRow;
int m_numCol;
int m_startCol;
int m_startRow;
char** m_maze;
};
#endif