示例#1
0
        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 static ModernModeStatsContainer <WeaponSlot> GetModernWeaponStatsFor <T>(this T client, AccountInfo account, PlaylistType playlistType = PlaylistType.All, OperatorType operatorType = OperatorType.Independent, DateTimeOffset?startDate = null, DateTimeOffset?endDate = null)
            where T : ModernDragon6Client
        {
            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.Perform <JObject>(request)
                   .ProcessData <WeaponSlot>(request, client));
        }