-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBoard.h
48 lines (40 loc) · 1.87 KB
/
Board.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
#ifndef BOARD_H
#define BOARD_H
/**
* @file Board.h
* @brief The Board class declaration file.
*
* @author Joey Ferguson
* @date March 2016
*/
class Board;
#include "Human.h"
using namespace std;
/**
* @class Board
* @brief The Board class declaration.
*/
class Board {
public:
Board(int numRows, int numCols, int numHumans); // Board class constructor
~Board(); // Board class destructor
void run(); // Main function that runs the simulation
void endScreen(); // Function that displays the initial screen when you run the simulation
bool tryMove(int row, int col); // Function that lets human know whether move is ok
static const int MAX_HUMAN_COUNT = 100; // Maximum humans simulation can handle
protected:
void processInfection(); // Go through and process infection status
bool allHealed(); // Tells whether all humans are infected
bool isNextTo(Human* h1, Human* h2); // Tells whether one human is next to another
Human* humans[MAX_HUMAN_COUNT];
int numHumans; // Number of humans
int numInfected; // Number of humans infected
int numNurses; // Number of nurses
int numDead; // Number of infected people that died
int numHealed; // Number of people that got healed by nurses
int currentTime; // Current time in simulation
int numRows; // Number of rows in board
int numCols; // Number of cols in board
int uSleepTime; // Number of microseconds to sleep between updates
};
#endif //#ifndef BOARD_H