using System;
using System.Collections.Generic;
using UnityEngine.Scripting;
using System.Runtime.Serialization;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Unity.Services.Lobbies.Http;
namespace Unity.Services.Lobbies.Models
{
///
/// Information about a specific player creating, joining, or already in a lobby.
/// The unique identifier for the player. If not provided for a create or join request it will be set to the id of the caller.
/// (TBD) Connection information for connecting to a relay with this player.
/// Custom game-specific properties that apply to an individual player (e.g. `role` or `skill`).
/// An id that associates this player in this lobby with a persistent connection. When a disconnect notification is recevied, this value is used to identify the associated player in a lobby to mark them as disconnected.
/// The time at which the player joined the lobby.
/// The last time the metadata for this player was updated.
///
[Preserve]
[DataContract(Name = "Player")]
public class Player
{
///
/// Information about a specific player creating, joining, or already in a lobby.
///
/// The unique identifier for the player. If not provided for a create or join request it will be set to the id of the caller.
/// (TBD) Connection information for connecting to a relay with this player.
/// Custom game-specific properties that apply to an individual player (e.g. `role` or `skill`).
/// An id that associates this player in this lobby with a persistent connection. When a disconnect notification is recevied, this value is used to identify the associated player in a lobby to mark them as disconnected.
/// The time at which the player joined the lobby.
/// The last time the metadata for this player was updated.
[Preserve]
public Player(string id = default, string connectionInfo = default, Dictionary data = default, string allocationId = default, DateTime joined = default, DateTime lastUpdated = default)
{
Id = id;
ConnectionInfo = connectionInfo;
Data = data;
AllocationId = allocationId;
Joined = joined;
LastUpdated = lastUpdated;
}
///
/// The unique identifier for the player. If not provided for a create or join request it will be set to the id of the caller.
///
[Preserve]
[DataMember(Name = "id", EmitDefaultValue = false)]
public string Id{ get; }
///
/// (TBD) Connection information for connecting to a relay with this player.
///
[Preserve]
[DataMember(Name = "connectionInfo", EmitDefaultValue = false)]
public string ConnectionInfo{ get; }
///
/// Custom game-specific properties that apply to an individual player (e.g. `role` or `skill`).
///
[Preserve]
[DataMember(Name = "data", EmitDefaultValue = false)]
public Dictionary Data{ get; }
///
/// An id that associates this player in this lobby with a persistent connection. When a disconnect notification is recevied, this value is used to identify the associated player in a lobby to mark them as disconnected.
///
[Preserve]
[DataMember(Name = "allocationId", EmitDefaultValue = false)]
public string AllocationId{ get; }
///
/// The time at which the player joined the lobby.
///
[Preserve]
[DataMember(Name = "joined", EmitDefaultValue = false)]
public DateTime Joined{ get; }
///
/// The last time the metadata for this player was updated.
///
[Preserve]
[DataMember(Name = "lastUpdated", EmitDefaultValue = false)]
public DateTime LastUpdated{ get; }
}
}