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

import eu.jonahbauer.wizard.common.messages.data.PlayerData;
import lombok.EqualsAndHashCode;
import lombok.Getter;

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

@Getter
@EqualsAndHashCode(callSuper = true)
public final class JoinedSessionMessage extends ServerMessage implements Response {
    /**
     * UUID of joined session
     */
    private final UUID session;
    /**
     * UUID assigned to the player
     */
    private final UUID player;
    /**
     * List of players already in the session
     */
    private final List<PlayerData> players;

    public JoinedSessionMessage(UUID session, UUID player, List<PlayerData> players) {
        this.session = session;
        this.player = player;
        this.players = List.copyOf(players);
    }
}
