-
Notifications
You must be signed in to change notification settings - Fork 0
/
game.h
49 lines (39 loc) · 1.21 KB
/
game.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
#ifndef game_h
#define game_h
#include <QSharedPointer>
#include <QObject>
#include "board.h"
class Game : public QObject
{
Q_OBJECT
public:
Game(int boardSize, int difficulty, int style, QString playerName1, QString playerName2);
Game(CELL_STATE player, int boardSize, int difficulty, int style, QString playerName1);
~Game();
QSharedPointer<Board> getBoard() const;
signals:
void turnTaken(CELL_STATE byWhom, CELL_STATE nextTurn);
void scoreChanged(int white, int black);
void gameOver(CELL_STATE winner, int white, int black);
public slots:
void handleCellClicked(BoardPosition where);
QString getPlayerName1();
QString getPlayerName2();
CELL_STATE getPlayersToken();
private slots:
void handleTurnTaken(CELL_STATE byWhom, CELL_STATE nextTurn);
void handleGameOver(CELL_STATE winner, int white, int black);
void handleScoreChanged(int white, int black);
void makeAIMove();
void saveHighscore(int white, int black);
protected:
void setBoard(QSharedPointer<Board> nBoard);
private:
QSharedPointer<Board> board;
CELL_STATE aiPlayer;
CELL_STATE player;
int difficulty;
QString playerName1;
QString playerName2;
};
#endif // game_h