Files
WotBlitzStatisticsBlazor/WotBlitzStatisticsPro.Common/Model/TankInfoResponse.cs
T

210 lines
4.8 KiB
C#
Raw Normal View History

2020-09-30 19:30:36 +02:00
using System;
namespace WotBlitzStatisticsPro.Common.Model
{
/// <summary>
/// Information about player's tank
/// </summary>
2021-06-04 14:13:16 +02:00
public class TankInfoResponse: IStatisticsResponse
2020-09-30 19:30:36 +02:00
{
///<summary>
/// Player account identifier
///</summary>
public long AccountId { get; set; }
///<summary>
/// Tank identifier
///</summary>
public long TankId { get; set; }
/// <summary>
/// Information is tank in garage or not. Information is not provided without Auth token
/// </summary>
public bool? InGarage { get; set; }
///<summary>
/// Mark of Mastery
///</summary>
public MarkOfMastery MarkOfMastery { get; set; }
/// <summary>
2021-06-04 14:13:16 +02:00
/// Total time in battle until tank killed
2020-09-30 19:30:36 +02:00
/// </summary>
2021-06-04 14:13:16 +02:00
public int BattleLifeTimeInSeconds { get; set; }
2020-09-30 19:30:36 +02:00
/// <summary>
/// Average life time in battle until tank is killed.
/// </summary>
2021-06-04 14:13:16 +02:00
public decimal AvgBattleLifeTimeInMinutes => (decimal)BattleLifeTimeInSeconds / (60 * Battles);
2021-02-26 16:56:39 +01:00
2020-09-30 19:30:36 +02:00
/// <summary>
/// Tank name
/// </summary>
2020-12-27 12:39:25 +01:00
public string? Name { get; set; }
2020-09-30 19:30:36 +02:00
/// <summary>
/// Tank nation dictionary identifier
/// </summary>
2020-12-27 12:39:25 +01:00
public string? TankNationId { get; set; }
2020-09-30 19:30:36 +02:00
/// <summary>
/// Localized tank nation name
/// </summary>
2020-12-27 12:39:25 +01:00
public string? TankNation { get; set; }
2020-09-30 19:30:36 +02:00
/// <summary>
/// Tank tier
/// </summary>
public int Tier { get; set; }
/// <summary>
/// Tank type dictionary identifier
/// </summary>
2020-12-27 12:39:25 +01:00
public string? TankTypeId { get; set; }
2020-09-30 19:30:36 +02:00
/// <summary>
/// Localized tank type name
/// </summary>
2020-12-27 12:39:25 +01:00
public string? TankType { get; set; }
2020-09-30 19:30:36 +02:00
/// <summary>
/// Is it premium tank or not
/// </summary>
public bool IsPremium { get; set; }
2021-05-28 16:06:36 +02:00
/// <summary>
/// Vehicle preview image
/// </summary>
public string? PreviewImage { get; set; }
/// <summary>
/// Vehicle normal image
/// </summary>
public string? NormalImage { get; set; }
2021-06-04 14:13:16 +02:00
#region statistics
2021-05-28 16:06:36 +02:00
2021-06-04 14:13:16 +02:00
///<summary>
/// Last battle time
///</summary>
public DateTime LastBattleTime { get; set; } = new DateTime(1970, 1, 1);
///<summary>
/// Battles count
///</summary>
public long Battles { get; set; }
///<summary>
/// Capture points
///</summary>
public long CapturePoints { get; set; }
///<summary>
/// Total damage amount
///</summary>
public long DamageDealt { get; set; }
///<summary>
/// Total amount of received damage
///</summary>
public long DamageReceived { get; set; }
///<summary>
/// Dropped capture points
///</summary>
public long DroppedCapturePoints { get; set; }
///<summary>
/// Total amount of frags
///</summary>
public long Frags { get; set; }
///<summary>
/// Total amount of fras grater ten 8 lvl
///</summary>
public long Frags8P { get; set; }
///<summary>
/// Total amount of hits
///</summary>
public long Hits { get; set; }
///<summary>
/// Total amount of losses
///</summary>
public long Losses { get; set; }
///<summary>
/// Max frags per battle
///</summary>
public long MaxFrags { get; set; }
///<summary>
/// Max experience per battle
///</summary>
public long MaxXp { get; set; }
///<summary>
/// Total shots count
///</summary>
public long Shots { get; set; }
///<summary>
/// Total count of spotted vehicles
///</summary>
public long Spotted { get; set; }
///<summary>
/// Total count of survived battles
///</summary>
public long SurvivedBattles { get; set; }
///<summary>
/// Total count of survived and won battles
///</summary>
public long WinAndSurvived { get; set; }
///<summary>
/// Total wins count
///</summary>
public long Wins { get; set; }
///<summary>
/// Total amount of experience
///</summary>
public long Xp { get; set; }
/// <summary>
/// Wn7 coefficient
/// </summary>
public double Wn7 { get; set; }
/// <summary>
/// Player's win rate
/// </summary>
public decimal WinRate => Battles == 0 ? 0m : (decimal)100 * Wins / Battles;
/// <summary>
/// Player's average damage
/// </summary>
public decimal AvgDamage => Battles == 0 ? 0m : (decimal)DamageDealt / Battles;
/// <summary>
/// Player's average XP
/// </summary>
public decimal AvgXp => Battles == 0 ? 0m : (decimal)Xp / Battles;
/// <summary>
/// Damage coefficient
/// </summary>
public decimal DamageCoefficient => DamageReceived == 0 ? 0m : (decimal)DamageDealt / DamageReceived;
/// <summary>
/// Rate of survival
/// </summary>
public decimal SurvivalRate => Battles == 0 ? 0m : (decimal)100 * SurvivedBattles / Battles;
#endregion
}
2020-09-30 19:30:36 +02:00
}