From 4c007940c9c1b2ab34740f4ff5dc90163b6506ff Mon Sep 17 00:00:00 2001 From: Calcitem Date: Thu, 5 Dec 2019 00:33:53 +0800 Subject: [PATCH] =?UTF-8?q?evaluate:=20=E8=A1=A5=E5=85=85=20getValue()=20?= =?UTF-8?q?=E4=B8=AD=E7=9A=84=20else=20if?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ai/evaluate.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ai/evaluate.cpp b/src/ai/evaluate.cpp index 99e6d367..115a61e7 100644 --- a/src/ai/evaluate.cpp +++ b/src/ai/evaluate.cpp @@ -118,7 +118,7 @@ value_t Evaluation::getValue(Game &tempGame, Position *position, AIAlgorithm::No } // 走棋阶段被闷判断 - if (position->action == ACTION_CHOOSE && + else if (position->action == ACTION_CHOOSE && tempGame.position.board.isAllSurrounded(position->sideId, position->nPiecesOnBoard, position->sideToMove) && rule.isLoseWhenNoWay) { // 规则要求被“闷”判负,则对手获胜 @@ -127,7 +127,7 @@ value_t Evaluation::getValue(Game &tempGame, Position *position, AIAlgorithm::No } // 剩余棋子个数判断 - if (position->nPiecesOnBoard[BLACK] < rule.nPiecesAtLeast) { + else if (position->nPiecesOnBoard[BLACK] < rule.nPiecesAtLeast) { value -= VALUE_WIN; } else if (position->nPiecesOnBoard[WHITE] < rule.nPiecesAtLeast) { value += VALUE_WIN;