merge websocket server logic
This commit is contained in:
parent
3cea9c967d
commit
57c0d229f1
9 changed files with 199 additions and 162 deletions
|
@ -1,10 +1,10 @@
|
|||
namespace TanksServer.Models;
|
||||
|
||||
internal sealed record class Scores(int Kills = 0, int Deaths = 0)
|
||||
internal sealed record class Scores
|
||||
{
|
||||
public int Kills { get; set; } = Kills;
|
||||
public int Kills { get; set; }
|
||||
|
||||
public int Deaths { get; set; } = Deaths;
|
||||
public int Deaths { get; set; }
|
||||
|
||||
public double Ratio
|
||||
{
|
||||
|
@ -14,7 +14,7 @@ internal sealed record class Scores(int Kills = 0, int Deaths = 0)
|
|||
return 0;
|
||||
if (Deaths == 0)
|
||||
return Kills;
|
||||
return Kills / (double)Deaths;
|
||||
return Math.Round(Kills / (double)Deaths, 3);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue