package eu.jonahbauer.wizard.common.messages.observer;

import eu.jonahbauer.wizard.common.model.Card;
import lombok.EqualsAndHashCode;
import lombok.Getter;

import java.util.List;
import java.util.UUID;

/**
 * A {@link TrickMessage} is sent when a trick is completed. It contains the player who won the trick and a list of the
 * cards played.
 */
@Getter
@EqualsAndHashCode(callSuper = true)
public final class TrickMessage extends ObserverMessage {
    /**
     * The UUID of the player who won the trick.
     */
    private final UUID player;
    /**
     * The cards played.
     */
    private final List<Card> cards;

    public TrickMessage(UUID player, List<Card> cards) {
        this.player = player;
        this.cards = List.copyOf(cards);
    }
}
