package de.vivi.chess.pieces; import de.vivi.chess.board.Board; import de.vivi.chess.board.Field; public abstract class Piece { Color color; private Type type; protected char symbol; protected Field field; protected Piece(Color color, Type type) { this.color = color; this.type = type; symbol = '\u0000'; } protected Piece(Color color, Field field) { this.color = color; this.field = field; } protected Piece(Color color, Type type, Field field) { this.color = color; this.type = type; this.field = field; } /** * TODO: implement *

* This method needs to be implemented in each piece by * using inheritance. It returns true if the move from the * from field to the to field is considered a valid move * for the type of piece this method is called on. Otherwise * it returns false. */ public abstract boolean isValidMove(Board board, Field from, Field to); public Color getColor() { // TODO: implement return color; } public Type getType() { // TODO: implement return type; } /** * TODO: implement *

* Use unicode symbols for the chess pieces. You can find * them here: * Unicode chess pieces */ public char getSymbol() { return symbol; } public Field getField() { return field; } public void setField(Field field) { this.field = field; } }