Account info DTO

This commit is contained in:
Mikhail Shabanov committed 2020-09-30 19:30:36 +02:00
1 parent b343e36e0d
commit 5e0369511f
16 files changed
+557 -35

No files matched your search

@@ -0,0 +1,157 @@
using System;
using System.Collections.Generic;
namespace WotBlitzStatisticsPro.Common.Model
{
/// <summary>
/// Information about player
/// </summary>
public class AccountInfoResponse
{
///<summary>
/// Player account identifier
///</summary>
public long AccountId { get; set; }
///<summary>
/// Account creation date
///</summary>
public DateTime CreatedAt { get; set; }
///<summary>
/// Last battle time
///</summary>
public DateTime LastBattleTime { get; set; }
///<summary>
/// Player's nick
///</summary>
public string Nickname { get; set; }
///<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>
/// Tank id, which kills max frags per battle
///</summary>
public long MaxFragsTankId { get; set; }
///<summary>
/// Max experience per battle
///</summary>
public long MaxXp { get; set; }
///<summary>
/// Tank Id which created max experience per battle
///</summary>
public long MaxXpTankId { 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 winned 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>
/// Average tier
/// </summary>
public double AvgTier { 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>
/// All player's tanks
/// </summary>
public List<TankInfoResponse> Tanks { get; set; }
}
}
@@ -0,0 +1,186 @@
using System;
namespace WotBlitzStatisticsPro.Common.Model
{
/// <summary>
/// Information about player's tank
/// </summary>
public class TankInfoResponse
{
///<summary>
/// Player account identifier
///</summary>
public long AccountId { get; set; }
///<summary>
/// Tank identifier
///</summary>
public long TankId { get; set; }
/// <summary>
/// Total time in battle until tank killed
/// </summary>
public int BattleLifeTimeInSeconds { get; set; }
///<summary>
/// Last battle
///</summary>
public DateTime LastBattleTime { 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>
/// Battles count
///</summary>
public long Battles { get; set; } = 1;
///<summary>
/// Base capture points
///</summary>
public long CapturePoints { get; set; }
///<summary>
/// Damage dealt
///</summary>
public long DamageDealt { get; set; }
///<summary>
/// Damage received
///</summary>
public long DamageReceived { get; set; }
///<summary>
/// Base dropped capture points
///</summary>
public long DroppedCapturePoints { get; set; }
///<summary>
/// Frags count
///</summary>
public long Frags { get; set; }
///<summary>
/// Frags count after 8 tier
///</summary>
public long Frags8P { get; set; }
///<summary>
/// Hits count
///</summary>
public long Hits { get; set; }
///<summary>
/// Losses count
///</summary>
public long Losses { get; set; }
///<summary>
/// Max frags per battle
///</summary>
public long MaxFrags { get; set; }
///<summary>
/// Max XP per battle
///</summary>
public long MaxXp { get; set; }
///<summary>
/// Shots count
///</summary>
public long Shots { get; set; }
///<summary>
/// Spotted vehicles count
///</summary>
public long Spotted { get; set; }
///<summary>
/// Amount of survived battles
///</summary>
public long SurvivedBattles { get; set; }
///<summary>
/// Amount of survived and wined battles
///</summary>
public long WinAndSurvived { get; set; }
///<summary>
/// Wins count
///</summary>
public long Wins { get; set; }
///<summary>
/// Total experience
///</summary>
public long Xp { get; set; }
/// <summary>
/// Wn7 coefficient
/// </summary>
public double Wn7 { get; set; }
/// <summary>
/// Average life time in battle until tank is killed.
/// </summary>
public decimal AvgBattleLifeTimeInMinutes => (decimal) BattleLifeTimeInSeconds / (60 * Battles);
/// <summary>
/// Tank's win rate
/// </summary>
public decimal WinRate => (decimal) 100 * Wins / Battles;
/// <summary>
/// Average tank's damage
/// </summary>
public decimal AvgDamage => (decimal) DamageDealt / Battles;
/// <summary>
/// Average XP
/// </summary>
public decimal AvgXp => (decimal) Xp / Battles;
/// <summary>
/// Tank name
/// </summary>
public string Name { get; set; }
/// <summary>
/// Tank nation dictionary identifier
/// </summary>
public string TankNationId { get; set; }
/// <summary>
/// Localized tank nation name
/// </summary>
public string TankNation { get; set; }
/// <summary>
/// Tank tier
/// </summary>
public int Tier { get; set; }
/// <summary>
/// Tank type dictionary identifier
/// </summary>
public string TankTypeId { get; set; }
/// <summary>
/// Localized tank type name
/// </summary>
public string TankType { get; set; }
/// <summary>
/// Is it premium tank or not
/// </summary>
public bool IsPremium { get; set; }
}
}