Make BeatmapManager inherit from new base class

This commit is contained in:
naoey
2019-06-11 19:36:08 +05:30
parent b4de51b612
commit 341d137f5c
5 changed files with 25 additions and 133 deletions

View File

@ -2,26 +2,20 @@
// See the LICENCE file in the repository root for full licence text.
using osu.Game.Beatmaps;
using System;
namespace osu.Game.Online.API.Requests
{
public class DownloadBeatmapSetRequest : APIDownloadRequest
public class DownloadBeatmapSetRequest : ArchiveDownloadModelRequest<BeatmapSetInfo>
{
public readonly BeatmapSetInfo BeatmapSet;
public float Progress;
public event Action<float> DownloadProgressed;
private readonly bool noVideo;
public DownloadBeatmapSetRequest(BeatmapSetInfo set, bool noVideo)
: base(set)
{
this.noVideo = noVideo;
BeatmapSet = set;
Progressed += (current, total) => DownloadProgressed?.Invoke(Progress = (float)current / total);
}
protected override string Target => $@"beatmapsets/{BeatmapSet.OnlineBeatmapSetID}/download{(noVideo ? "?noVideo=1" : "")}";