1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-25 23:02:59 +08:00
osu-lazer/osu.Game/Online/API/ArchiveDownloadRequest.cs
2019-06-12 21:56:36 +05:30

25 lines
660 B
C#

// 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.
using System;
namespace osu.Game.Online.API
{
public abstract class ArchiveDownloadRequest<TModel> : APIDownloadRequest
where TModel : class
{
public readonly TModel Model;
public float Progress;
public event Action<float> DownloadProgressed;
protected ArchiveDownloadRequest(TModel model)
{
Model = model;
Progressed += (current, total) => DownloadProgressed?.Invoke(Progress = (float)current / total);
}
}
}