public void addCard(Card card, boolean position) {
        if (position == TOP) {
            cardPile.addFirst(card);
        }
        else {
            cardPile.addLast(card);
        }

        if (component != null) {
            component.updateTopCard();
        }
    }