/// <summary> /// Initialises a <see cref="LegacyStatsRequest"/> for an array of <see cref="UbisoftAccount"/>s /// </summary> public LegacyStatsRequest(IEnumerable <UbisoftAccount> accounts, LegacyStatTypes stats) : base(accounts) { Types = stats; }
/// <summary> /// Gets the <see cref="LegacyStats"/> for the <see cref="UbisoftAccount"/>s provided /// </summary> /// <param name="client">The <see cref="Dragon6Client"/> to use</param> /// <param name="accounts">The <see cref="UbisoftAccount"/>s to get stats for</param> /// <param name="token">Optional cancellation token</param> /// <returns><see cref="IReadOnlyDictionary{TKey,TValue}"/> mapping the user profile id to the corresponding <see cref="LegacyStats"/></returns> public static Task <IReadOnlyDictionary <string, LegacyStats> > GetLegacyStatsAsync(this Dragon6Client client, IEnumerable <UbisoftAccount> accounts, CancellationToken token = default) { const LegacyStatTypes generalStats = LegacyStatTypes.All & ~(LegacyStatTypes.Operators | LegacyStatTypes.Weapons); return(GetLegacyStatsAsync(client, accounts, a => new LegacyStatsRequest(a, generalStats), LegacyStatsDeserializer.DeserializeGeneralStats, token)); }
public DefaultStatsAttribute(LegacyStatTypes targetCategory) { TargetCategory = targetCategory; }
/// <summary> /// Gets the stats identifiers for the <see cref="LegacyStatTypes"/> keys provided /// </summary> public static IEnumerable <string> GetDefaultStats(this LegacyStatTypes stats) { return(_categories.Where(x => (stats & x) == x) .Aggregate(Enumerable.Empty <string>(), (a, b) => _categoryKeys.TryGetValue(b, out var data) ? a.Concat(data) : a)); }