Fix AI value system
This commit is contained in:
parent
b4c9ca0105
commit
f16448bdf0
2 changed files with 2 additions and 2 deletions
|
@ -56,7 +56,7 @@ public class ChessAI {
|
||||||
Score score = new Score();
|
Score score = new Score();
|
||||||
board.forEachPiece((coordinate, piece) -> {
|
board.forEachPiece((coordinate, piece) -> {
|
||||||
if (!piece.black) {
|
if (!piece.black) {
|
||||||
score.add(piece.getValue());
|
score.add(-piece.getValue());
|
||||||
} else {
|
} else {
|
||||||
score.add(piece.getValue());
|
score.add(piece.getValue());
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,7 @@ public class King extends Piece {
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getValue() {
|
public int getValue() {
|
||||||
return Integer.MAX_VALUE;
|
return 12;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ArrayList<BoardCoordinate> getPossibleMoves(BoardCoordinate position, Board board) {
|
public ArrayList<BoardCoordinate> getPossibleMoves(BoardCoordinate position, Board board) {
|
||||||
|
|
Reference in a new issue