mirror of
https://github.com/DrMboga/WotBlitzStatisticsBlazor.git
synced 2026-10-23 19:30:06 +02:00
Account info DTO
This commit is contained in:
1 parent
b343e36e0d
commit
5e0369511f
16 files changed
+557
-35
No files matched your search
@@ -0,0 +1,17 @@
|
||||
using System;
|
||||
|
||||
namespace WotBlitzStatisticsPro.Logic.Calculations
|
||||
{
|
||||
public static class DateTimeHelper
|
||||
{
|
||||
public static DateTime ToDateTime(this int unixTimeStamp)
|
||||
{
|
||||
// Unix timestamp is seconds past epoch
|
||||
var dtDateTime = new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc);
|
||||
dtDateTime = dtDateTime.AddSeconds(unixTimeStamp).ToLocalTime();
|
||||
return dtDateTime;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -14,9 +14,9 @@ namespace WotBlitzStatisticsPro.Logic.Calculations
|
||||
}
|
||||
foreach (var tank in allTanks)
|
||||
{
|
||||
if (tankTires.ContainsKey(tank.TankId) && tank.Battles.HasValue && tank.Battles > 0)
|
||||
if (tankTires.ContainsKey(tank.TankId) && tank.Battles > 0)
|
||||
{
|
||||
x += tankTires[tank.TankId] * tank.Battles.Value;
|
||||
x += tankTires[tank.TankId] * tank.Battles;
|
||||
}
|
||||
}
|
||||
if (account.Battles > 0)
|
||||
|
||||
@@ -26,17 +26,13 @@ namespace WotBlitzStatisticsPro.Logic.Calculations
|
||||
|
||||
public static void CalculateWn7(this TankInfoHistory tank, double tier)
|
||||
{
|
||||
if (!tank.Battles.HasValue)
|
||||
{
|
||||
return;
|
||||
}
|
||||
double avdFrags = tank.Frags.DoubleValue() / tank.Battles.DoubleValue();
|
||||
double avgDamage = tank.DamageDealt.DoubleValue() / tank.Battles.DoubleValue();
|
||||
double avgSpot = tank.Spotted.DoubleValue() / tank.Battles.DoubleValue();
|
||||
double avgDef = tank.DroppedCapturePoints.DoubleValue() / tank.Battles.DoubleValue();
|
||||
double winRate = (100d * tank.Wins.DoubleValue() / tank.Battles.DoubleValue()); // - 48;
|
||||
double avdFrags = (double) tank.Frags / tank.Battles;
|
||||
double avgDamage = (double)tank.DamageDealt / tank.Battles;
|
||||
double avgSpot = (double)tank.Spotted / tank.Battles;
|
||||
double avgDef = (double)tank.DroppedCapturePoints / tank.Battles;
|
||||
double winRate = (100d * (double) tank.Wins / tank.Battles); // - 48;
|
||||
|
||||
tank.Wn7 = CalculateWn7(tank.Battles.Value, tier, avdFrags, avgDamage, avgSpot, avgDef, winRate);
|
||||
tank.Wn7 = CalculateWn7(tank.Battles, tier, avdFrags, avgDamage, avgSpot, avgDef, winRate);
|
||||
}
|
||||
|
||||
public static void CalculateWn7(this AccountInfoHistory account)
|
||||
|
||||
Reference in new issue
Block a user