mirror of
https://github.com/lov3b/Schack.git
synced 2025-04-18 20:30:12 +02:00

Lade till javadoc kommentarer samt fixade till ful kod till snygg kod. Exempelvis att vi inte använde this.position istället för selected
22 lines
532 B
Java
22 lines
532 B
Java
package schack;
|
|
|
|
import java.awt.Point;
|
|
import java.io.IOException;
|
|
import java.util.ArrayList;
|
|
|
|
public class Queen extends LongWalkers {
|
|
|
|
public Queen(boolean isWhite, Point point) throws IOException {
|
|
super(isWhite, point);
|
|
}
|
|
|
|
@Override
|
|
public ArrayList<Point> validMoves(Piece[][] pieces, boolean isSelected) {
|
|
return getMoves(
|
|
new int[][]{{1, 0}, {-1, 0}, {0, 1}, {-1, -1}, {0, -1}, {1, 1}, {-1, 1}, {1, -1}},
|
|
pieces,
|
|
isSelected
|
|
);
|
|
}
|
|
}
|