@@ -889,35 +889,6 @@ public int heuristicValue(final int movesPlayed,
889889 }
890890
891891 public int evaluatePosition (final Board board ) {
892- double firstPlayerMoveScore = 0 , secondPlayerMoveScore = 0 ;
893- double firstPlayerBlockScore = 0 , secondPlayerBlockScore = 0 ;
894- double firstPlayerCaptureScore = 0 , secondPlayerCaptureScore = 0 ;
895- final Set <Cell > firstPlayerDestinations = Arrays .stream (board .moves [1 ])
896- .filter (Objects ::nonNull )
897- .map (move -> move .end )
898- .collect (Collectors .toSet ()),
899- secondPlayerDestinations = Arrays .stream (board .moves [2 ])
900- .filter (Objects ::nonNull )
901- .map (move -> move .end )
902- .collect (Collectors .toSet ());
903- for (int i = 0 ; i < board .options [1 ]; i ++) {
904- if (moves [1 ][i ].isACapture ()) {
905- firstPlayerCaptureScore ++;
906- } else if (secondPlayerDestinations .contains (moves [1 ][i ].end )) {
907- firstPlayerBlockScore ++;
908- } else {
909- firstPlayerMoveScore ++;
910- }
911- }
912- for (int i = 0 ; i < board .options [2 ]; i ++) {
913- if (moves [2 ][i ].isACapture ()) {
914- secondPlayerCaptureScore ++;
915- } else if (secondPlayerDestinations .contains (moves [1 ][i ].end )) {
916- secondPlayerBlockScore ++;
917- } else {
918- secondPlayerMoveScore ++;
919- }
920- }
921892 return (board .pieceCount [1 ] - board .pieceCount [2 ]) * MinMax .PIECE_VALUE ;
922893 }
923894
0 commit comments