将 check_gameover_condition() 中对于对方是否总子数少于3的判断转移到 remove_piece() 中
This commit is contained in:
parent
6173894f20
commit
c4be5d3da9
src
|
@ -764,7 +764,10 @@ bool Position::remove_piece(Square s, bool updateCmdlist)
|
|||
|
||||
pieceCountOnBoard[them]--;
|
||||
|
||||
if (check_gameover_condition()) {
|
||||
if (pieceCountOnBoard[them] + pieceCountInHand[them] < rule.nPiecesAtLeast) {
|
||||
winner = sideToMove;
|
||||
phase = PHASE_GAMEOVER;
|
||||
gameoverReason = LOSE_REASON_LESS_THAN_THREE;
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
@ -975,16 +978,6 @@ bool Position::check_gameover_condition()
|
|||
return true;
|
||||
}
|
||||
|
||||
for (int i = 1; i <= 2; i++)
|
||||
{
|
||||
if (pieceCountOnBoard[i] + pieceCountInHand[i] < rule.nPiecesAtLeast) {
|
||||
winner = ~Color(i);
|
||||
phase = PHASE_GAMEOVER;
|
||||
gameoverReason = LOSE_REASON_LESS_THAN_THREE;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef MCTS_AI
|
||||
#if 0
|
||||
int diff = pieceCountOnBoard[BLACK] - pieceCountOnBoard[WHITE];
|
||||
|
|
Loading…
Reference in New Issue