2019-07-01 19:50:42 +02:00
|
|
|
package dev.kske.chess.piece;
|
2019-07-01 19:08:37 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Project: <strong>Chess</strong><br>
|
|
|
|
* File: <strong>Piece.java</strong><br>
|
|
|
|
* Created: <strong>01.07.2019</strong><br>
|
|
|
|
* Author: <strong>Kai S. K. Engelbart</strong>
|
|
|
|
*/
|
|
|
|
public abstract class Piece {
|
|
|
|
|
2019-07-01 21:46:30 +02:00
|
|
|
protected Color color;
|
2019-07-01 19:37:15 +02:00
|
|
|
|
|
|
|
public Piece(Color color) {
|
|
|
|
this.color = color;
|
|
|
|
}
|
|
|
|
|
2019-07-01 21:46:30 +02:00
|
|
|
public abstract boolean isValidMove(int xPos, int yPos, int xDest, int yDest);
|
|
|
|
|
2019-07-01 19:08:37 +02:00
|
|
|
public abstract Type getType();
|
|
|
|
|
2019-07-01 19:37:15 +02:00
|
|
|
public Color getColor() { return color; }
|
|
|
|
|
2019-07-01 19:08:37 +02:00
|
|
|
public static enum Type {
|
|
|
|
KING, QUEEN, ROOK, KNIGHT, BISHOP, PAWN;
|
|
|
|
}
|
2019-07-01 19:37:15 +02:00
|
|
|
|
|
|
|
public static enum Color {
|
|
|
|
WHITE, BLACK;
|
|
|
|
}
|
2019-07-01 19:08:37 +02:00
|
|
|
}
|