package chessGame;

public class Knight extends ChessPiece {

	private final int score=20;
	private final int rank=2;
	
	public Knight(ChessPlayer player, String position) {
		super(player, position);	
	}
	
	public boolean isValidMove(String moveTo) {
		// TO-DO: add Exception out of the board scope 
		// throw new UnsupportedOperationException();
		// TO-DO: Exception own chess
		
		ChessMonitoringSystem CMS = ChessMonitoringSystem.getInstance();
		if(CMS.getChessPiece(moveTo)==null || 
				CMS.getChessPiece(moveTo).getPlayer()!=this.player)
		{
			int xPosDiff = moveTo.charAt(0)-position.charAt(0);
			int yPosDiff = moveTo.charAt(1)-position.charAt(1);
			if (Math.abs(xPosDiff)==2 && Math.abs(yPosDiff)==1)
				return true;
			else if (Math.abs(xPosDiff)==1 && Math.abs(yPosDiff)==2)
				return true;
		}
		return false;
	}

	public int getScore(){
		return score;
	}

	@Override
	public String toString(){
		if (player.getPlayerId()==1)
			return "N";
		else if (player.getPlayerId()==2)
			return "n";
		else
			return null;
	}

	@Override
	public int getRank() {
		return rank;
	}
}
@@ -93,36 +93,8 @@
 0;%0D%0A
-%09private final int rank=2;%0D%0A
 %09%0D%0A%09
@@ -1055,62 +1055,7 @@
 %0D%0A%0D%0A
-%09@Override%0D%0A%09public int getRank() %7B%0D%0A%09%09return rank;%0D%0A%09
 %7D%0D%0A
-%7D

Update Knight.java