-
Notifications
You must be signed in to change notification settings - Fork 1
/
cgobangchessman.h
62 lines (47 loc) · 1.26 KB
/
cgobangchessman.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
54
55
56
57
58
59
60
61
62
/******************************
* Author : YangRongBao
* Date : 2021.4
******************************/
#ifndef CGOBANGCHESSMAN_H
#define CGOBANGCHESSMAN_H
#include <QObject>
#define INITIALSCORE 1000
class CGobangChessman : public QObject
{
Q_OBJECT
signals:
public:
enum CChessmanType
{
Chessman_Black,
Chessman_None,
Chessman_White,
};
enum CDirectionType
{
Direction_Backslash,
Direction_Slash,
Direction_Horizontal,
Direction_Vertical,
};
explicit CGobangChessman();
~CGobangChessman();
void addScore(int score);
bool isEmpty();
bool powerScore(double power);
bool powerScore(CDirectionType directionType, double power);
void restart();
double score();
bool setChessman(CChessmanType type);
CChessmanType type();
protected:
private:
bool m_isEmpty; //是否落子
double m_backslash; //反斜杠方向的分数
double m_slash; //斜杠方向的分数
double m_horizontal; //斜杠方向的分数
double m_vertical; //斜杠方向的分数
CChessmanType m_type; //棋子类型
private slots:
};
#endif // CGOBANGCHESSMAN_H