1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-15 10:42:54 +08:00
osu-lazer/osu.Game/Online/API/Requests/DownloadBeatmapSetRequest.cs

30 lines
897 B
C#
Raw Normal View History

// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
2018-04-13 17:19:50 +08:00
using osu.Game.Beatmaps;
using System;
namespace osu.Game.Online.API.Requests
{
public class DownloadBeatmapSetRequest : APIDownloadRequest
{
public readonly BeatmapSetInfo BeatmapSet;
2019-01-31 18:08:45 +08:00
public float Progress;
public event Action<float> DownloadProgressed;
2018-04-13 17:19:50 +08:00
private readonly bool noVideo;
public DownloadBeatmapSetRequest(BeatmapSetInfo set, bool noVideo)
{
this.noVideo = noVideo;
BeatmapSet = set;
2019-01-31 18:08:45 +08:00
Progressed += (current, total) => DownloadProgressed?.Invoke(Progress = (float)current / total);
2018-04-13 17:19:50 +08:00
}
protected override string Target => $@"beatmapsets/{BeatmapSet.OnlineBeatmapSetID}/download{(noVideo ? "?noVideo=1" : "")}";
}
}