mirror of
https://github.com/DrMboga/WotBlitzStatisticsBlazor.git
synced 2026-11-22 21:56:06 +01:00
Added tanks stat info operation and calculation tier and Wn7 operation
This commit is contained in:
1 parent
3eeda15491
commit
b343e36e0d
14 files changed
+394
-4
No files matched your search
+16
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user