This repository has been archived on 2026-07-13. You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.
servicepoint-tanks/tanks-backend/TanksServer/Models/Scores.cs
Vinzenz Schroeter 10f022c849 more scores
2024-04-22 21:26:46 +02:00

26 lines
585 B
C#

namespace TanksServer.Models;
internal sealed record class Scores
{
public int Kills { get; set; }
public int Deaths { get; set; }
public double Ratio
{
get
{
if (Kills == 0)
return 0;
if (Deaths == 0)
return Kills;
return Math.Round(Kills / (double)Deaths, 3);
}
}
public int WallsDestroyed { get; set; }
public int ShotsFired { get; set; }
public int OverallScore => Math.Max(0, 10000 * Kills - 1000 * Deaths + 10 * ShotsFired + 10 * WallsDestroyed);
}