A simple data transfer object used by the Protocol layer to represent a player. It contains Team, Slot, Alias and Name properties and customizes JSON property names for serialization. ToString returns Alias.
using System.Text.Json.Serialization;
namespace APLib.Protocol;
public sealed class NetworkPlayer
{
[JsonPropertyName( "team" )]
public int Team { get; set; }
[JsonPropertyName( "slot" )]
public int Slot { get; set; }
[JsonPropertyName( "alias" )]
public string Alias { get; set; }
[JsonPropertyName( "name" )]
public string Name { get; set; }
public override string ToString()
{
return Alias;
}
}