@Override
	public ArrayList<XY> getPossibleMoves(Board board) {
		ArrayList<XY> output = super.getPossibleMoves(board);
		int kingX = this.getXY().getX();
		int kingY = this.getXY().getY();
		
		boolean isUntouchedKing = this.getRank().getIndex().equals("k") && this.isTouched() == false;
		if (isUntouchedKing == true) {
			// left and right castling check:
			for (int x = 0; x <= 7; x = x + 7) {
				int stepsX = x - kingX;
				int direction = stepsX / Math.abs(stepsX);
				Figure rook = board.getFigure(x, kingY);
				if (rook != null && rook.isTouched() == false) {
					boolean isAbleToCastle = true;
					for (int i = 1; i < Math.abs(stepsX); i++) {
						int newX = kingX + i * direction;
						Figure fig = board.getFigure(newX, kingY);
						boolean isEmpty = (fig == null);
						if (isEmpty) {
							continue;
						} else {
							isAbleToCastle = false;
							break;
						}
					}
					if (isAbleToCastle == true)
						output.add(XY.getNewXY(kingX + direction * 2, kingY));
				}
			}
		}
		
		return output;
	}