-
Notifications
You must be signed in to change notification settings - Fork 0
/
Controller.h
53 lines (36 loc) · 931 Bytes
/
Controller.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
#ifndef CONTROLLER_H
#define CONTROLLER_H
/*
* Class to receive input from the user, and return a string to
* display. Also returns whether to continue the game.
*
*/
#include <stdexcept>
#include <string>
#include "Player.h"
#include "Game.h"
#include "Mapper.h"
#include "View.h"
#include "Step.h"
using namespace std;
const string CT_MOVE_MESSAGE = "Please choose 1-9 to move,\nY for a new game,\nor Q to quit.\n";
const string CT_BYE_MESSAGE = "Thanks for playing!\n";
const string CT_BAD_ENTRY_MESSAGE = "Invalid input\n";
class Controller
{
public:
Controller();
~Controller();
// The second parameter is filled with a message to display
// to the human playing the game.
bool addResponse(char input, string& message);
private:
Mapper mapper_m;
Player human_m;
Player computer_m;
Game game_m;
View view_m;
bool continue_game_m;
Step* step_m_p;
};
#endif // CONTROLLER_H