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

import eu.jonahbauer.wizard.common.model.Card;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import org.jetbrains.annotations.NotNull;

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

/**
 * A {@link HandMessage} is sent when the player receives information about hit own or another player's hand cards.
 */
@Getter
@EqualsAndHashCode(callSuper = true)
public final class HandMessage extends ObserverMessage {
    /**
     * The UUID of player whose hand cards are sent.
     */
    private final @NotNull UUID player;
    /**
     * A list of all the hand cards. May consist only of {@link Card#HIDDEN} if the cars are not visible to the player
     * receiving this message
     */
    private final @NotNull List<@NotNull Card> hand;

    public HandMessage(@NotNull UUID player, @NotNull List<@NotNull Card> hand) {
        this.player = player;
        this.hand = List.copyOf(hand);
    }
}
