Want to contribute? Fork me on Codeberg.org!
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.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

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;
}
}