// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using System; namespace osu.Game.Online.API { public abstract class ArchiveDownloadRequest : APIDownloadRequest where TModel : class { public readonly TModel Model; public double Progress { get; private set; } public event Action DownloadProgressed; protected ArchiveDownloadRequest(TModel model) { Model = model; Progressed += (current, total) => SetProgress((double)current / total); } protected void SetProgress(double progress) { Progress = progress; DownloadProgressed?.Invoke(progress); } } }