package chess; /* * Knight.java * * Created on February 10, 2007, 6:43 PM * * To change this template, choose Tools | Template Manager * and open the template in the editor. */ /** * * @author Stanislav Hromek */ public class Knight extends Piece { // because of javascript, we can not use get class name private static final String name = "knight"; /** Creates a new instance of Knight */ public Knight(String pieceColor) { this.pieceColor = pieceColor; } /** * knight road is always ok, as there is none */ boolean isRoadOk(Board board, String movePieceFrom, String movePieceTo) { return true; } boolean possibleToMoveToEndSquare(Board board, String movePieceFrom, String movePieceTo) { if(board.isKnightMove(movePieceFrom, movePieceTo)) return true; else return false; } public String getName() { return name; } }