public void swapCards(Card card1, Card card2) {
        int index1 = hand.indexOf(card1);
        int index2 = hand.indexOf(card2);

        if (index1 < 0 || index2 < 0) {
            return;
        }

        hand.set(index1, card2);
        hand.set(index2, card1);

        if (component != null) {
            component.swapCards(card1, card2);
        }
    }