Added tanks stat info operation and calculation tier and Wn7 operation

This commit is contained in:
Mikhail Shabanov committed 2020-09-22 17:54:35 +02:00
1 parent 3eeda15491
commit b343e36e0d
14 files changed
+394 -4

No files matched your search

@@ -91,5 +91,15 @@ namespace WotBlitzStatisticsPro.DataAccess
.FindAsync(Builders<ILanguageDictionary>.Filter.Empty);
return collection.ToList();
}
public async Task<Dictionary<long, int>> GetTankTires(long[] tankIds)
{
var collection = await _database.GetCollection<VehiclesDictionary>(VehiclesCollectionName)
.Find(Builders<VehiclesDictionary>.Filter.In(v => v.TankId, tankIds))
.Project(v => new { TankId = v.TankId, Tier = v.Tier })
.ToListAsync();
return collection.ToDictionary(k => k.TankId, v => v.Tier);
}
}
}
@@ -21,5 +21,7 @@ namespace WotBlitzStatisticsPro.DataAccess
Task UpdateVehicles(List<IVehiclesDictionary> vehiclesDictionary);
Task<List<ILanguageDictionary>> ReadLanguages();
Task<Dictionary<long, int>> GetTankTires(long[] tankIds);
}
}
@@ -1,7 +1,40 @@
namespace WotBlitzStatisticsPro.DataAccess.Model.Accounts
using WotBlitzStatisticsPro.Common.Model;
namespace WotBlitzStatisticsPro.DataAccess.Model.Accounts
{
public class TankInfo
{
///<summary>
/// Player account identifier
///</summary>
public long AccountId { get; set; }
///<summary>
/// Tank identifier
///</summary>
public long TankId { get; set; }
public int BattleLifeTimeInSeconds { get; set; }
///<summary>
/// Last battle
///</summary>
public int LastBattleTime { get; set; }
public bool? InGarage { get; set; }
private int? InGarageUpdated { get; set; }
///<summary>
/// Mastery:
///
/// 0 — None
/// 1 — Rank 3
/// 2 — Rank 2
/// 3 — Rank 1
/// 4 — Mastery
///</summary>
public MarkOfMastery MarkOfMastery { get; set; }
}
}
@@ -0,0 +1,113 @@
namespace WotBlitzStatisticsPro.DataAccess.Model.Accounts
{
public class TankInfoHistory
{
///<summary>
/// Player account identifier
///</summary>
public long AccountId { get; set; }
///<summary>
/// Tank identifier
///</summary>
public long TankId { get; set; }
///<summary>
/// Last battle
///</summary>
public int LastBattleTime { get; set; }
///<summary>
/// Battles count
///</summary>
public long? Battles { get; set; }
///<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; }
}
}