MovePicker::score() 中不再使用 them 成员变量
并且将 pos 直接访问成员变量改为通过函数
This commit is contained in:
parent
051085beb9
commit
4e50c2deca
|
@ -67,7 +67,7 @@ void MovePicker::score()
|
|||
Square sqsrc = from_sq(m);
|
||||
|
||||
// if stat before moving, moving phrase maybe from @-0-@ to 0-@-@, but no mill, so need sqsrc to judge
|
||||
int nOurMills = pos.in_how_many_mills(sq, pos.sideToMove, sqsrc);
|
||||
int nOurMills = pos.in_how_many_mills(sq, pos.side_to_move(), sqsrc);
|
||||
int nTheirMills = 0;
|
||||
|
||||
#ifndef SORT_MOVE_WITHOUT_HUMAN_KNOWLEDGES
|
||||
|
@ -78,13 +78,13 @@ void MovePicker::score()
|
|||
cur->value += RATING_ONE_MILL * nOurMills;
|
||||
} else if (pos.get_phase() == PHASE_PLACING) {
|
||||
// placing phrase, check if place sq can block their close mill
|
||||
nTheirMills = pos.in_how_many_mills(sq, pos.them);
|
||||
nTheirMills = pos.in_how_many_mills(sq, ~pos.side_to_move());
|
||||
cur->value += RATING_BLOCK_ONE_MILL * nTheirMills;
|
||||
}
|
||||
#if 1
|
||||
else if (pos.get_phase() == PHASE_MOVING) {
|
||||
// moving phrase, check if place sq can block their close mill
|
||||
nTheirMills = pos.in_how_many_mills(sq, pos.them);
|
||||
nTheirMills = pos.in_how_many_mills(sq, ~pos.side_to_move());
|
||||
|
||||
if (nTheirMills) {
|
||||
int nOurPieces = 0;
|
||||
|
@ -134,7 +134,7 @@ void MovePicker::score()
|
|||
}
|
||||
|
||||
// remove point is in their mill
|
||||
nTheirMills = pos.in_how_many_mills(sq, pos.them);
|
||||
nTheirMills = pos.in_how_many_mills(sq, ~pos.side_to_move());
|
||||
if (nTheirMills) {
|
||||
if (nTheirPieces >= 2) {
|
||||
// if nearby their piece, prefer do not remove
|
||||
|
|
Loading…
Reference in New Issue