Ejemplo n.º 1
0
 /// <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;
 }
Ejemplo n.º 2
0
        /// <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;
 }
Ejemplo n.º 4
0
 /// <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));
 }