mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 08:20:00 +09:00
Make downloads happen in BeatmapManager.
This commit is contained in:
21
osu.Game/Online/API/Requests/DownloadBeatmapSetRequest.cs
Normal file
21
osu.Game/Online/API/Requests/DownloadBeatmapSetRequest.cs
Normal 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";
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user