// 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 float Progress { get; private set; } public event Action DownloadProgressed; protected ArchiveDownloadRequest(TModel model) { Model = model; Progressed += (current, total) => SetProgress((float)current / total); } protected void SetProgress(float progress) { Progress = progress; DownloadProgressed?.Invoke(progress); } } }