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

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

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 @NonNull UUID player;
    /**
     * A list of all the hand cards. May consist only of {@link Card#HIDDEN} if the cards are not visible to the player
     * receiving this message.
     */
    private final @Unmodifiable @NonNull List<@NotNull Card> hand;

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