1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-12 03:17:45 +08:00
osu-lazer/osu.Game/Online/API/ArchiveDownloadModelRequest.cs

24 lines
571 B
C#

using System;
using System.Collections.Generic;
using System.Text;
namespace osu.Game.Online.API
{
public abstract class ArchiveDownloadModelRequest<TModel> : APIDownloadRequest
where TModel : class
{
public readonly TModel Info;
public float Progress;
public event Action<float> DownloadProgressed;
protected ArchiveDownloadModelRequest(TModel model)
{
Info = model;
Progressed += (current, total) => DownloadProgressed?.Invoke(Progress = (float)current / total);
}
}
}