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

import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.NonNull;
import org.jetbrains.annotations.Unmodifiable;

import java.util.Map;
import java.util.UUID;

/**
 * A {@link ScoreMessage} is sent at the end of each round and at the end of the game. It contains the number of points
 * gained by each player in this round or the final result.
 */
@Getter
@EqualsAndHashCode(callSuper = true)
public final class ScoreMessage extends ObserverMessage {
    /**
     * The number of points for each player.
     */
    private final @Unmodifiable @NonNull Map<@NonNull UUID, @NonNull Integer> points;

    public ScoreMessage(@NonNull Map<@NonNull UUID, @NonNull Integer> points) {
        this.points = Map.copyOf(points);
    }
}
