Files
Quadraludi/LobbyServer/ScoreEntry.cs
2019-05-04 17:51:19 +02:00

28 lines
603 B
C#

using Newtonsoft.Json;
namespace LobbyServer
{
public class ScoreEntry
{
public string Pseudo { get; }
public int Score { get; }
[JsonConstructor]
public ScoreEntry(string pseudo, int score)
{
Pseudo = pseudo;
Score = score;
}
public ScoreEntry(string serialized)
{
var split = serialized.Split(';');
Pseudo = split[0];
Score = int.Parse(split[1]);
}
public override string ToString()
{
return $"{Pseudo};{Score}";
}
}
}