示例#1
0
    private static void DownloadData(JsonDownloader downloader)
    {
        downloader.Update("gods.json", c => c.GetGodsAsync());

        DownloadAllGodSkinsForStoredGods(downloader);

        downloader.Update(filenameOrRelPath: "items.json", c => c.GetItemsAsync());
    }
示例#2
0
 private static void DownloadAllGodSkinsForStoredGods(JsonDownloader d)
 {
     foreach (var godId in new DataStore().ReadGods().Select(x => x.Id))
     {
         d.Update(filenameOrRelPath: $"godskins/godskins-{godId}.json", c => c.GetGodSkinsAsync(godId));
     }
 }
示例#3
0
    private static void DownloadPlayer(RequestClient c, int playerId, string dataDirPath)
    {
        var playerPath = Path.Combine(dataDirPath, "player", playerId.ToString(provider: null));
        var d          = new JsonDownloader(c, playerPath);

        d.Update(filenameOrRelPath: "player.json", c => c.GetPlayerAsync(playerId));
        d.Update(filenameOrRelPath: "godranks.json", c => c.GetPlayerGodRanksAsync(playerId));
        d.Update(filenameOrRelPath: "friends.json", c => c.GetPlayerFriendsAsync(playerId));
        d.Update(filenameOrRelPath: "achievements.json", c => c.GetPlayerAchievementsAsync(playerId));
        d.Update(filenameOrRelPath: "status.json", c => c.GetPlayerStatusAsync(playerId));
        d.Update(filenameOrRelPath: "matchhistory.json", c => c.GetPlayerMatchHistoryAsync(playerId));
    }