-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path__deprecate.txt
167 lines (128 loc) · 4.67 KB
/
__deprecate.txt
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
auto __update_00 = [&](int xop, int yop, int mask) {
ll before_score, after_score;
for (int i = -UPDATE_DIS; i <= UPDATE_DIS; i++)
{
int xx = x + i * xop;
int yy = y + i * yop;
if (tmpGameBoard->getWhoPiece(xx, yy) == 2) //none
{
bool is_find = (nextStepMap[0].find({ xx,yy }) != nextStepMap[0].end());
if ((abs(i) <= NEW_NEXT_DIS) || (is_find))
{
//black
auto last_move1 = tmpGameBoard->fakePopPiece(x, y);
tmpGameBoard->fakePutPiece(xx, yy, 1);
before_score = 0;
if (is_find)
before_score = judgeDragon_A(tmpGameBoard, xx, yy, mask);
tmpGameBoard->fakePutPiece(x, y, last_move1);
after_score = judgeDragon_A(tmpGameBoard, xx, yy, mask);
tmpGameBoard->fakePopPiece(xx, yy);
nextStepMap[0][{xx, yy}] += after_score - before_score * (is_find);
//white
auto last_move2 = tmpGameBoard->fakePopPiece(x, y);
tmpGameBoard->fakePutPiece(xx, yy, 2);
before_score = 0;
if (is_find)
before_score = judgeDragon_A(tmpGameBoard, xx, yy, mask);
tmpGameBoard->fakePutPiece(x, y, last_move2);
after_score = judgeDragon_A(tmpGameBoard, xx, yy, mask);
tmpGameBoard->fakePopPiece(xx, yy);
nextStepMap[1][{xx, yy}] += after_score - before_score * (is_find);
}
}
}
};
auto __update_1 = [&]() {
ll before_score, after_score;
for (int i = -UPDATE_DIS; i <= UPDATE_DIS; i++)
{
int xx = x + i;
int yy = y + i;
if (tmpGameBoard->getWhoPiece(xx, yy) == 2) //none
{
bool is_find = (nextStepMap[0].find({ xx,yy }) != nextStepMap[0].end());
if ((abs(i) <= NEW_NEXT_DIS) || (is_find))
{
//black
auto last_move1 = tmpGameBoard->fakePopPiece(x, y);
tmpGameBoard->fakePutPiece(xx, yy, 1);
before_score = judgeDragon_A_1(tmpGameBoard, xx, yy);
tmpGameBoard->fakePutPiece(x, y, last_move1);
after_score = judgeDragon_A_1(tmpGameBoard, xx, yy);
tmpGameBoard->fakePopPiece(xx, yy);
nextStepMap[0][{xx, yy}] += after_score - before_score * (is_find);
//white
auto last_move2 = tmpGameBoard->fakePopPiece(x, y);
tmpGameBoard->fakePutPiece(xx, yy, 2);
before_score = judgeDragon_A_1(tmpGameBoard, xx, yy);
tmpGameBoard->fakePutPiece(x, y, last_move2);
after_score = judgeDragon_A_1(tmpGameBoard, xx, yy);
tmpGameBoard->fakePopPiece(xx, yy);
nextStepMap[1][{xx, yy}] += after_score - before_score * (is_find);
}
}
}
};
auto __update_2 = [&]() {
ll before_score, after_score;
for (int i = -UPDATE_DIS; i <= UPDATE_DIS; i++)
{
int xx = x + i;
int yy = y;
if (tmpGameBoard->getWhoPiece(xx, yy) == 2) //none
{
bool is_find = (nextStepMap[0].find({ xx,yy }) != nextStepMap[0].end());
if ((abs(i) <= NEW_NEXT_DIS) || (is_find))
{
//black
auto last_move1 = tmpGameBoard->fakePopPiece(x, y);
tmpGameBoard->fakePutPiece(xx, yy, 1);
before_score = judgeDragon_A_2(tmpGameBoard, xx, yy);
tmpGameBoard->fakePutPiece(x, y, last_move1);
after_score = judgeDragon_A_2(tmpGameBoard, xx, yy);
tmpGameBoard->fakePopPiece(xx, yy);
nextStepMap[0][{xx, yy}] += after_score - before_score * (is_find);
//white
auto last_move2 = tmpGameBoard->fakePopPiece(x, y);
tmpGameBoard->fakePutPiece(xx, yy, 2);
before_score = judgeDragon_A_2(tmpGameBoard, xx, yy);
tmpGameBoard->fakePutPiece(x, y, last_move2);
after_score = judgeDragon_A_2(tmpGameBoard, xx, yy);
tmpGameBoard->fakePopPiece(xx, yy);
nextStepMap[1][{xx, yy}] += after_score - before_score * (is_find);
}
}
}
};
auto __update_3 = [&]() {
ll before_score, after_score;
for (int i = -UPDATE_DIS; i <= UPDATE_DIS; i++)
{
int xx = x - i;
int yy = y + i;
if (tmpGameBoard->getWhoPiece(xx, yy) == 2) //none
{
bool is_find = (nextStepMap[0].find({ xx,yy }) != nextStepMap[0].end());
if ((abs(i) <= NEW_NEXT_DIS) || (is_find))
{
//black
auto last_move1 = tmpGameBoard->fakePopPiece(x, y);
tmpGameBoard->fakePutPiece(xx, yy, 1);
before_score = judgeDragon_A_3(tmpGameBoard, xx, yy);
tmpGameBoard->fakePutPiece(x, y, last_move1);
after_score = judgeDragon_A_3(tmpGameBoard, xx, yy);
tmpGameBoard->fakePopPiece(xx, yy);
nextStepMap[0][{xx, yy}] += after_score - before_score * (is_find);
//white
auto last_move2 = tmpGameBoard->fakePopPiece(x, y);
tmpGameBoard->fakePutPiece(xx, yy, 2);
before_score = judgeDragon_A_3(tmpGameBoard, xx, yy);
tmpGameBoard->fakePutPiece(x, y, last_move2);
after_score = judgeDragon_A_3(tmpGameBoard, xx, yy);
tmpGameBoard->fakePopPiece(xx, yy);
nextStepMap[1][{xx, yy}] += after_score - before_score * (is_find);
}
}
}
};