@Override
    public List<Move> getMoves(ChessBoard board) {
        Position tem;
        Coin c;
        LinkedList<Move> p = new LinkedList<Move>();
        for (int i = 0; i < 8; i++) {
            tem = Position.getPosition(getRank() + x[i], getFile() + y[i]);
            c = board.getCoinAt(tem);
            /*
             * c.getColor() != getColor()) 
             * it includes the condition c==Empty or opposite coin
             * 
             */
            if (c != null && (c.getColor() != getColor())) {
                p.add(new StandardMove(board, getPosition(), tem));
            }
        }
        if (isNotMovedYet()) {
            if (canKingSideCastle(board)) {
                KingSideCastling k = new KingSideCastling(this,
                        board.getCoinAt(KingSideCastling.getRookPosition(getColor())),
                        getPosition(),
                        KingSideCastling.getKingEndingPosition(getColor()), getColor());
                //if (!(board.isHasThreat(k.getKingEndPosition(), getOpponentColor(this)) || board.isHasThreat(k.getRookEndPosition(), getOpponentColor(this)))) {
                    p.add(k);
                //}
            }
            if (canQueenSideCastle(board)) {
                QueenSideCastling q = new QueenSideCastling(this,
                        board.getCoinAt(QueenSideCastling.getRookPosition(getColor())),
                        getPosition(),
                        QueenSideCastling.getKingEndingPosition(getColor()), getColor());
                //if (!(board.isHasThreat(q.getKingEndPosition(), getOpponentColor(this)) || board.isHasThreat(q.getRookEndPosition(), getOpponentColor(this)))) {
                    p.add(q);
                //}
            }
        }
        return p;
    }