import java.util.*; import javax.swing.ImageIcon; public class Knight extends Piece { static int[] xDir = {-1, -2, -2, -1, 1, 2, 2, 1}; static int[] yDir = {-2, -1, 1, 2, 2, 1, -1, -2}; public Knight(int x, int y, String color) { super(x, y, color, new ImageIcon("sprites/" + color + "/knight.png").getImage()); } public ArrayList getLegalMoves(Board board) { ArrayList positions = new ArrayList(); for (int i : xDir) { for (int j : yDir) { Position test = new Position(pos.x + i, pos.y + j); if (!Board.inBounds(test)) continue; } } return positions; } }