servicepoint-tanks/TanksServer/Models/Scores.cs

21 lines
418 B
C#
Raw Normal View History

2024-04-13 18:35:36 +02:00
namespace TanksServer.Models;
internal sealed record class Scores(int Kills = 0, int Deaths = 0)
{
public int Kills { get; set; } = Kills;
public int Deaths { get; set; } = Deaths;
public double Ratio
{
get
{
if (Kills == 0)
return 0;
if (Deaths == 0)
return Kills;
return Kills / (double)Deaths;
}
}
2024-04-13 18:35:36 +02:00
}