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

@@ -1,8 +1,11 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using AutoMapper;
using WotBlitzStatisticsPro.DataAccess.Model.Accounts;
using WotBlitzStatisticsPro.Logic.Pipeline;
using WotBlitzStatisticsPro.WgApiClient;
using WotBlitzStatisticsPro.WgApiClient.Model;
namespace WotBlitzStatisticsPro.Logic.AccountInformationPipeline.Operations
{
@@ -24,6 +27,19 @@ namespace WotBlitzStatisticsPro.Logic.AccountInformationPipeline.Operations
var tanksInfo = await
_wargamingApi.GetPlayerAccountTanksInfo(context.AccountId, context.RealmType, context.RequestLanguage);
context.Tanks = new List<TankInfo>();
context.TanksHistory = new Dictionary<long, TankInfoHistory>();
tanksInfo.ForEach(tank =>
{
context.Tanks.Add(_mapper.Map<WotAccountTanksStatistics, TankInfo>(tank));
var stat = _mapper.Map<WotAccountTanksFullStatistics, TankInfoHistory>(tank.All);
stat.AccountId = tank.AccountId;
stat.TankId = tank.TankId;
stat.LastBattleTime = tank.LastBattleTime;
context.TanksHistory[stat.TankId] = stat;
});
await next.Invoke(context);
}
}