-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathController.h
More file actions
40 lines (33 loc) · 731 Bytes
/
Copy pathController.h
File metadata and controls
40 lines (33 loc) · 731 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
#ifndef CONTROLLER_H
#define CONTROLLER_H
#include <QObject>
#include "Common.h"
class Controller : public QObject
{
Q_OBJECT
public:
explicit Controller(QObject *parent, int row, int column);
~Controller();
void reset();
void start(Qizi qizi, bool firstDrop);
bool drop(Step step);
bool remove(Pos pos);
void clear();
Qizi myQizi();
Qizi otherQizi();
bool isMyTurn();
void setMyTurn(bool myTurn);
bool checkWin(Step lastStep);
signals:
void gameOver(Qizi qizi);
protected:
Qizi getQizi(Pos pos);
int countSameQizi(Step step, int colOffset, int rowOffset);
protected:
int m_row;
int m_column;
Qizi** m_board;
Qizi m_myQizi;
bool m_myTurn;
};
#endif // CONTROLLER_H