Make downloads happen in BeatmapManager.

This commit is contained in:
naoey
2017-09-08 22:37:28 +05:30
parent 4dc67ed796
commit 20f93c83d6
6 changed files with 115 additions and 65 deletions

View File

@ -0,0 +1,21 @@
using osu.Game.Beatmaps;
using System;
namespace osu.Game.Online.API.Requests
{
public class DownloadBeatmapSetRequest : APIDownloadRequest
{
private readonly BeatmapSetInfo beatmapSet;
public Action<float> DownloadProgressed;
public DownloadBeatmapSetRequest(BeatmapSetInfo beatmapSet)
{
this.beatmapSet = beatmapSet;
Progress += (current, total) => DownloadProgressed?.Invoke((float) current / total);
}
protected override string Target => $@"beatmapsets/{beatmapSet.OnlineBeatmapSetID}/download";
}
}