You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
736 B
22 lines
736 B
import java.util.ArrayList;
|
|
|
|
public class Bishop extends Piece {
|
|
public Bishop(boolean black, DrawingPanel panel) {
|
|
super(black, panel, "black-bishop.png", "white-bishop.png");
|
|
}
|
|
|
|
public int getValue() {
|
|
return 3;
|
|
}
|
|
|
|
public ArrayList<Move> getPossibleMoves(BoardCoordinate position, Board board) {
|
|
ArrayList<Move> possibleMoves = new ArrayList<>();
|
|
|
|
getPossibleMovesInDirection(1, 1, position, board, possibleMoves);
|
|
getPossibleMovesInDirection(-1, -1, position, board, possibleMoves);
|
|
getPossibleMovesInDirection(1, -1, position, board, possibleMoves);
|
|
getPossibleMovesInDirection(-1, 1, position, board, possibleMoves);
|
|
|
|
return possibleMoves;
|
|
}
|
|
} |