This repository has been archived on 2021-02-18. You can view files and clone it, but cannot push or open issues or pull requests.
chess/src/dev/kske/chess/piece/Bishop.java

23 lines
527 B
Java
Raw Normal View History

package dev.kske.chess.piece;
/**
* Project: <strong>Chess</strong><br>
* File: <strong>Bishop.java</strong><br>
* Created: <strong>01.07.2019</strong><br>
* Author: <strong>Kai S. K. Engelbart</strong>
*/
public class Bishop extends Piece {
public Bishop(Color color) {
super(color);
}
@Override
public boolean isValidMove(int xPos, int yPos, int xDest, int yDest) {
return Math.abs(xDest - xPos) == Math.abs(yDest - yPos);
}
@Override
public Type getType() { return Type.BISHOP; }
}