-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathGrid.h
46 lines (37 loc) · 1.05 KB
/
Grid.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
#ifndef GRID_H
#define GRID_H
#include <iostream>
#include <fstream>
#include <cstdlib>
#include <time.h>
using namespace std;
class Grid
{
public:
//constructors
Grid(); //default
Grid(int h, int w, double d); //random cells only
Grid(string filePath); //file input
Grid(Grid& other); // copy constructor
//Destructor
~Grid();
//Mutator functions
void genGrid(); //creates array framework
void setGrid(ifstream& mapFile); //sets array based off of a mapfile
void setGrid(double density); //sets grid using height width and density
void setGrid(); //sets grid randomly
void setHeight(int h);
void setWidth(int w);
void setCell(int i, int j, bool val);
//Accessor functions
int getHeight();
int getWidth();
bool getCell(int i, int j);
void printGrid(); // prints grid to standard out
void printGridFile(ofstream& outFile); // attempts to print grid to outFile
private:
bool **gameGrid;
int height;
int width;
};
#endif