-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathArena.h
45 lines (35 loc) · 866 Bytes
/
Arena.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
#ifndef ARENA_INCLUDED
#define ARENA_INCLUDED
#include <string>
#include "globals.h"
#include "History.h"
class Player;
class Robot;
class Arena
{
public:
// Constructor/destructor
Arena(int nRows, int nCols);
~Arena();
// Accessors
int rows() const;
int cols() const;
Player* player() const;
int robotCount() const;
int nRobotsAt(int r, int c) const;
void display(std::string msg) const;
// Mutators
bool addRobot(int r, int c);
bool addPlayer(int r, int c);
bool destroyRobot(int r, int c);
bool moveRobots();
History &history();
private:
int m_rows;
int m_cols;
Player* m_player;
Robot* m_robots[MAXROBOTS];
int m_nRobots;
History m_history;
};
#endif // ARENA_INCLUDED