-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGameController.h
More file actions
46 lines (32 loc) · 768 Bytes
/
GameController.h
File metadata and controls
46 lines (32 loc) · 768 Bytes
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
#include "Player.h"
#include "TttBoard.h"
namespace TicTacToe {
class GameController {
public:
GameController(int numPlayers = 2, int dimension = 3);
~GameController();
void run();
void printBoard() const;
protected:
void getMove();
void incrementTurn();
int mTurn;
int mNumPlayers;
int mDimension;
Player** mPlayers;
TttBoard* mBoard;
// controller should
// wait on moves from the view
// ask model if the input is good
// update the model
// apprise the view of model state
// including whos turn it is and the board state
// view should
// promt plater for move
// hand input to controller
// promt user bad input
// else
// display new board state
// ask player for input
};
}