public void mousePressed(int mx, int my, GUIComponent component) {
        if (component instanceof CardComponent && component.belongsTo(playersComponent) && ((CardComponent) component).getAssociatedPlayer() instanceof HumanPlayer) {
            if (selectedCardComponent != component && selectedCardComponent != null) {
                ((CardComponent) component).getAssociatedPlayer().swapCards(((CardComponent) component).getCard(), selectedCardComponent.getCard());
                setSelectedCardComponent(null);
            }
            else {
                setSelectedCardComponent((CardComponent)component);
            }
        }
        else {
            setSelectedCardComponent(null);
        }
    }