mirror of
https://github.com/DrMboga/WotBlitzStatisticsBlazor.git
synced 2026-10-21 10:27:18 +02:00
103 lines
9.2 KiB
C#
103 lines
9.2 KiB
C#
// <auto-generated/>
|
|
#nullable enable
|
|
|
|
namespace WotBlitzStatisticsPro.Blazor.GraphQl.State
|
|
{
|
|
[global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.2.2.0")]
|
|
public partial class PlayerResultFactory : global::StrawberryShake.IOperationResultDataFactory<global::WotBlitzStatisticsPro.Blazor.GraphQl.PlayerResult>
|
|
{
|
|
private readonly global::StrawberryShake.IEntityStore _entityStore;
|
|
public PlayerResultFactory(global::StrawberryShake.IEntityStore entityStore)
|
|
{
|
|
_entityStore = entityStore ?? throw new global::System.ArgumentNullException(nameof(entityStore));
|
|
}
|
|
|
|
global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::WotBlitzStatisticsPro.Blazor.GraphQl.IPlayerResult);
|
|
public PlayerResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null)
|
|
{
|
|
if (snapshot is null)
|
|
{
|
|
snapshot = _entityStore.CurrentSnapshot;
|
|
}
|
|
|
|
if (dataInfo is PlayerResultInfo info)
|
|
{
|
|
return new PlayerResult(MapNonNullableIPlayer_AccountInfo(info.AccountInfo, snapshot));
|
|
}
|
|
|
|
throw new global::System.ArgumentException("PlayerResultInfo expected.");
|
|
}
|
|
|
|
private global::WotBlitzStatisticsPro.Blazor.GraphQl.IPlayer_AccountInfo MapNonNullableIPlayer_AccountInfo(global::WotBlitzStatisticsPro.Blazor.GraphQl.State.AccountInfoResponseData data, global::StrawberryShake.IEntityStoreSnapshot snapshot)
|
|
{
|
|
IPlayer_AccountInfo returnValue = default !;
|
|
if (data.__typename.Equals("AccountInfoResponse", global::System.StringComparison.Ordinal))
|
|
{
|
|
returnValue = new Player_AccountInfo_AccountInfoResponse(data.AccountId ?? throw new global::System.ArgumentNullException(), data.CreatedAt ?? throw new global::System.ArgumentNullException(), data.LastBattleTime ?? throw new global::System.ArgumentNullException(), data.Nickname, data.MaxFragsTankId ?? throw new global::System.ArgumentNullException(), data.MaxXpTankId ?? throw new global::System.ArgumentNullException(), data.Battles ?? throw new global::System.ArgumentNullException(), data.CapturePoints ?? throw new global::System.ArgumentNullException(), data.DamageDealt ?? throw new global::System.ArgumentNullException(), data.DamageReceived ?? throw new global::System.ArgumentNullException(), data.DroppedCapturePoints ?? throw new global::System.ArgumentNullException(), data.Frags ?? throw new global::System.ArgumentNullException(), data.Frags8P ?? throw new global::System.ArgumentNullException(), data.Hits ?? throw new global::System.ArgumentNullException(), data.Losses ?? throw new global::System.ArgumentNullException(), data.MaxFrags ?? throw new global::System.ArgumentNullException(), data.MaxXp ?? throw new global::System.ArgumentNullException(), data.Shots ?? throw new global::System.ArgumentNullException(), data.Spotted ?? throw new global::System.ArgumentNullException(), data.SurvivedBattles ?? throw new global::System.ArgumentNullException(), data.WinAndSurvived ?? throw new global::System.ArgumentNullException(), data.Wins ?? throw new global::System.ArgumentNullException(), data.Xp ?? throw new global::System.ArgumentNullException(), data.Wn7 ?? throw new global::System.ArgumentNullException(), data.WinRate ?? throw new global::System.ArgumentNullException(), data.AvgDamage ?? throw new global::System.ArgumentNullException(), data.AvgXp ?? throw new global::System.ArgumentNullException(), data.DamageCoefficient ?? throw new global::System.ArgumentNullException(), data.SurvivalRate ?? throw new global::System.ArgumentNullException(), data.AvgTier ?? throw new global::System.ArgumentNullException(), MapIPlayer_AccountInfo_ClanInfo(data.ClanInfo, snapshot), MapIPlayer_AccountInfo_TanksNonNullableArray(data.Tanks, snapshot));
|
|
}
|
|
else
|
|
{
|
|
throw new global::System.NotSupportedException();
|
|
}
|
|
|
|
return returnValue;
|
|
}
|
|
|
|
private global::WotBlitzStatisticsPro.Blazor.GraphQl.IPlayer_AccountInfo_ClanInfo? MapIPlayer_AccountInfo_ClanInfo(global::WotBlitzStatisticsPro.Blazor.GraphQl.State.ClanInfoResponseData? data, global::StrawberryShake.IEntityStoreSnapshot snapshot)
|
|
{
|
|
if (data is null)
|
|
{
|
|
return null;
|
|
}
|
|
|
|
IPlayer_AccountInfo_ClanInfo returnValue = default !;
|
|
if (data?.__typename.Equals("ClanInfoResponse", global::System.StringComparison.Ordinal) ?? false)
|
|
{
|
|
returnValue = new Player_AccountInfo_ClanInfo_ClanInfoResponse(data.ClanId ?? throw new global::System.ArgumentNullException(), data.JoinedAt ?? throw new global::System.ArgumentNullException(), data.Role, data.RoleLocalized ?? throw new global::System.ArgumentNullException(), data.Name, data.CreatedAt ?? throw new global::System.ArgumentNullException(), data.CreatorId, data.CreatorName, data.Description, data.DescriptionHtml, data.LeaderId, data.LeaderName, data.MembersCount, data.Motto, data.Tag, data.UpdatedAt);
|
|
}
|
|
else
|
|
{
|
|
throw new global::System.NotSupportedException();
|
|
}
|
|
|
|
return returnValue;
|
|
}
|
|
|
|
private global::System.Collections.Generic.IReadOnlyList<global::WotBlitzStatisticsPro.Blazor.GraphQl.IPlayer_AccountInfo_Tanks>? MapIPlayer_AccountInfo_TanksNonNullableArray(global::System.Collections.Generic.IReadOnlyList<global::WotBlitzStatisticsPro.Blazor.GraphQl.State.TankInfoResponseData>? list, global::StrawberryShake.IEntityStoreSnapshot snapshot)
|
|
{
|
|
if (list is null)
|
|
{
|
|
return null;
|
|
}
|
|
|
|
var tankInfoResponses = new global::System.Collections.Generic.List<global::WotBlitzStatisticsPro.Blazor.GraphQl.IPlayer_AccountInfo_Tanks>();
|
|
foreach (global::WotBlitzStatisticsPro.Blazor.GraphQl.State.TankInfoResponseData child in list)
|
|
{
|
|
tankInfoResponses.Add(MapNonNullableIPlayer_AccountInfo_Tanks(child, snapshot));
|
|
}
|
|
|
|
return tankInfoResponses;
|
|
}
|
|
|
|
private global::WotBlitzStatisticsPro.Blazor.GraphQl.IPlayer_AccountInfo_Tanks MapNonNullableIPlayer_AccountInfo_Tanks(global::WotBlitzStatisticsPro.Blazor.GraphQl.State.TankInfoResponseData data, global::StrawberryShake.IEntityStoreSnapshot snapshot)
|
|
{
|
|
IPlayer_AccountInfo_Tanks returnValue = default !;
|
|
if (data.__typename.Equals("TankInfoResponse", global::System.StringComparison.Ordinal))
|
|
{
|
|
returnValue = new Player_AccountInfo_Tanks_TankInfoResponse(data.TankId ?? throw new global::System.ArgumentNullException(), data.BattleLifeTimeInSeconds ?? throw new global::System.ArgumentNullException(), data.LastBattleTime ?? throw new global::System.ArgumentNullException(), data.MarkOfMastery ?? throw new global::System.ArgumentNullException(), data.Battles ?? throw new global::System.ArgumentNullException(), data.CapturePoints ?? throw new global::System.ArgumentNullException(), data.DamageDealt ?? throw new global::System.ArgumentNullException(), data.DamageReceived ?? throw new global::System.ArgumentNullException(), data.DroppedCapturePoints ?? throw new global::System.ArgumentNullException(), data.Frags ?? throw new global::System.ArgumentNullException(), data.Frags8P ?? throw new global::System.ArgumentNullException(), data.Hits ?? throw new global::System.ArgumentNullException(), data.Losses ?? throw new global::System.ArgumentNullException(), data.MaxFrags ?? throw new global::System.ArgumentNullException(), data.MaxXp ?? throw new global::System.ArgumentNullException(), data.Shots ?? throw new global::System.ArgumentNullException(), data.Spotted ?? throw new global::System.ArgumentNullException(), data.SurvivedBattles ?? throw new global::System.ArgumentNullException(), data.WinAndSurvived ?? throw new global::System.ArgumentNullException(), data.Wins ?? throw new global::System.ArgumentNullException(), data.Xp ?? throw new global::System.ArgumentNullException(), data.Wn7 ?? throw new global::System.ArgumentNullException(), data.WinRate ?? throw new global::System.ArgumentNullException(), data.AvgDamage ?? throw new global::System.ArgumentNullException(), data.AvgXp ?? throw new global::System.ArgumentNullException(), data.DamageCoefficient ?? throw new global::System.ArgumentNullException(), data.SurvivalRate ?? throw new global::System.ArgumentNullException(), data.AvgBattleLifeTimeInMinutes ?? throw new global::System.ArgumentNullException(), data.Name, data.TankNationId, data.TankNation, data.Tier ?? throw new global::System.ArgumentNullException(), data.TankTypeId, data.TankType, data.IsPremium ?? throw new global::System.ArgumentNullException(), data.PreviewImage, data.NormalImage);
|
|
}
|
|
else
|
|
{
|
|
throw new global::System.NotSupportedException();
|
|
}
|
|
|
|
return returnValue;
|
|
}
|
|
|
|
global::System.Object global::StrawberryShake.IOperationResultDataFactory.Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot)
|
|
{
|
|
return Create(dataInfo, snapshot);
|
|
}
|
|
}
|
|
}
|