/// <summary> /// Get seasonal stats for the provided <see cref="UbisoftAccount"/> /// </summary> /// <param name="client">The <see cref="Dragon6Client"/> to use</param> /// <param name="account">The <see cref="UbisoftAccount"/> to get stats for</param> /// <param name="seasonId">The season id. Defaults to the current season</param> /// <param name="board">The leaderboard to get rankings for</param> /// <param name="region">The region to get stats for. Seasons after ~17 do not need to set this</param> /// <param name="token">Optional cancellation token</param> public static Task <SeasonalStats> GetSeasonalStatsAsync(this Dragon6Client client, UbisoftAccount account, int seasonId = -1, BoardType board = BoardType.Ranked, Region region = Region.EMEA, CancellationToken token = default) { var request = new SeasonalStatsRequest(account.Yield(), board, seasonId, region); return(client.PerformAsync <SeasonalStatsResponse>(request, token).ContinueWith(t => t.Result.For(account), TaskContinuationOptions.OnlyOnRanToCompletion)); }
public static bool TryRetrieveFor <T>(this IReadOnlyDictionary <string, T> lookup, UbisoftAccount account, out T output) where T : class { output = For(lookup, account); return(output != null); }
public static bool TryRetrieveFor <T>(this ILookup <string, T> lookup, UbisoftAccount account, out IEnumerable <T> output) where T : class { output = For(lookup, account); return(output != null); }
public static T For <T>(this IReadOnlyDictionary <string, T> lookup, UbisoftAccount account) where T : class => For(lookup, account.ProfileId);
public static IEnumerable <T> For <T>(this ILookup <string, T> lookup, UbisoftAccount account) where T : class => For(lookup, account.ProfileId);
public ModernMapStatsRequest(UbisoftAccount account) : base(account) { }
public ModernWeaponStatsRequest(UbisoftAccount account) : base(account) { }
public static Task <ModernModeStatsContainer <WeaponSlot> > GetModernWeaponStatsAsync(this Dragon6Client client, UbisoftAccount account, PlaylistType playlistType = PlaylistType.All, OperatorType operatorType = OperatorType.Independent, DateTimeOffset?startDate = null, DateTimeOffset?endDate = null) { var request = new ModernWeaponStatsRequest(account) { Playlist = playlistType, OperatorType = operatorType }; ValueUtils.ApplyValue(startDate, s => request.StartDate = s); ValueUtils.ApplyValue(endDate, e => request.EndDate = e); return(client.PerformAsync <JObject>(request) .ContinueWith(t => t.Result.ProcessData <WeaponSlot>(request), TaskContinuationOptions.OnlyOnRanToCompletion)); }
public ModernStatsTrendRequest(UbisoftAccount account) : base(account) { }
protected ModernStatsRequest(UbisoftAccount account) { Account = account ?? throw new NullReferenceException(); }
public static Task <ModernModeStatsContainer <IEnumerable <ModernSeasonStats> > > GetModernSeasonStatsAsync(this Dragon6Client client, UbisoftAccount account, PlaylistType playlistType = PlaylistType.All) { var request = new ModernSeasonalStatsRequest(account) { Playlist = playlistType }; return(client.PerformAsync <JObject>(request) .ContinueWith(t => t.Result.ProcessData <IEnumerable <ModernSeasonStats> >(request), TaskContinuationOptions.OnlyOnRanToCompletion)); }
public SeasonalStats For(UbisoftAccount account) => For(account.ProfileId);
public ModernOperatorStatsRequest(UbisoftAccount account) : base(account) { }
public ModernStatsSummaryRequest(UbisoftAccount account) : base(account) { }
/// <summary> /// Gets the <see cref="LegacyWeaponStats"/> for the <see cref="UbisoftAccount"/> provided /// </summary> /// <param name="client">The <see cref="Dragon6Client"/> to use</param> /// <param name="account">The <see cref="UbisoftAccount"/> to get stats for</param> /// <param name="token">Optional cancellation token</param> /// <returns><see cref="IEnumerable{T}"/> of <see cref="LegacyWeaponStats"/> for the provided <see cref="UbisoftAccount"/></returns> public static Task <IEnumerable <LegacyWeaponStats> > GetLegacyWeaponStatsAsync(this Dragon6Client client, UbisoftAccount account, CancellationToken token = default) { return(GetLegacyWeaponStatsAsync(client, account.Yield(), token).ContinueWith(t => t.Result.For(account), TaskContinuationOptions.OnlyOnRanToCompletion)); }
/// <summary> /// Creates a <see cref="UbisoftAccountActivityRequest"/> for a single <see cref="UbisoftAccount"/> /// </summary> public UbisoftAccountActivityRequest(UbisoftAccount profile) : this(profile.Yield()) { }
public ModernSeasonalStatsRequest(UbisoftAccount account) : base(account) { }
/// <summary> /// Retrieves the play statistics for a <see cref="UbisoftAccount"/> /// </summary> /// <param name="client">The <see cref="Dragon6Client"/> to use</param> /// <param name="account">The <see cref="UbisoftAccount"/> to get play stats for</param> /// <returns>The <see cref="UbisoftAccountActivity"/> for the account, or <c>null</c> if the user does not own the game</returns> public static Task <UbisoftAccountActivity> GetAccountActivityAsync(this Dragon6Client client, UbisoftAccount account) { var request = new UbisoftAccountActivityRequest(account); return(client.PerformAsync <JObject>(request).ContinueWith(t => t.Result.DeserializeUbisoftAccountActivity().For(account), TaskContinuationOptions.OnlyOnRanToCompletion)); }