-
Notifications
You must be signed in to change notification settings - Fork 0
/
dot.h
83 lines (60 loc) · 1.68 KB
/
dot.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#ifndef DOT_H
#define DOT_H
#include <QPoint>
#include <QDebug>
#include "chessboard.h"
#define DOT_SUCCEET 0
#define DOT_ACTIVE4 1
#define DOT_DEATH4 2
#define DOT_ACTIVE3 3
#define DOT_DEATH3 4
#define DOT_ACTIVE2 5
class Dot;
struct DotMessage{
int white[10];
int black[10];
DotMessage(){
memset(white,0,sizeof(white));
memset(black,0,sizeof(black));
}
void init(){
memset(white,0,sizeof(white));
memset(black,0,sizeof(black));
}
};
class Dot
{
public:
Dot();
void init();
bool setBoard(const ChessBoard &board, const QPoint &point);
DotMessage getDotMessage()const;
bool isDotNoMessage(const int &color)const;
int getDotStatusByColor(const int &color) const;
int getDotScore()const;
int getDotScore(const int &color)const;
bool operator <(const Dot &dot)const;
bool operator == (const Dot &dot)const;
int getEmmironmentScore()const;
DotMessage dot_mes;
QPoint chess;
bool isDotBan(const int &color)const;
bool changlian;
static bool compareDotScore(const Dot &dot1,const Dot &dot2);
private:
void DotScan0(const int &judge,bool &f4);
void DotScan1(const int &judge,bool &f4);
void DotScan2(const int &judge,bool &f4);
void DotScan3(const int &judge,bool &f4);
void DotScan4(const int &judge,bool &f4);
void DotScan5(const int &judge,bool &f4);
void LineScan(ChessLine line);
int getLineToJudge(const ChessLine &line,const int &left,const int &right);
int getNumber(const int &number);
void AddTypeCountOfColor(const int &type,const int &color);
int w_tiaosan;
int w_tiaosi;
int b_tiaosan;
int b_tiaosi;
};
#endif // DOT_H