mirror of
https://github.com/lov3b/Schack.git
synced 2025-04-18 20:30:12 +02:00
30 lines
645 B
Java
30 lines
645 B
Java
package schack;
|
|
|
|
import java.awt.Point;
|
|
import java.io.IOException;
|
|
import java.util.ArrayList;
|
|
|
|
public abstract class PieceKnownIfMoved extends Piece {
|
|
|
|
protected boolean hasMoved = false;
|
|
|
|
public PieceKnownIfMoved(boolean isWhite, Point startingPosition) throws IOException {
|
|
super(isWhite, startingPosition);
|
|
}
|
|
|
|
public boolean isSeen(ArrayList<Piece> pieces) {
|
|
return true;
|
|
}
|
|
|
|
@Override
|
|
public void move(Piece[][] pieces, Point toMove, Point selected) {
|
|
super.move(pieces, toMove, selected);
|
|
hasMoved = true;
|
|
}
|
|
|
|
public boolean hasMoved() {
|
|
return hasMoved;
|
|
}
|
|
|
|
}
|