2019-06-11 19:49:10 +05:30
|
|
|
|
// 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;
|
2019-06-11 18:29:33 +05:30
|
|
|
|
|
|
|
|
|
namespace osu.Game.Online.API
|
|
|
|
|
{
|
2019-06-12 13:30:23 +09:00
|
|
|
|
public abstract class ArchiveDownloadRequest<TModel> : APIDownloadRequest
|
2019-06-11 18:29:33 +05:30
|
|
|
|
where TModel : class
|
|
|
|
|
{
|
2019-06-12 21:56:36 +05:30
|
|
|
|
public readonly TModel Model;
|
2019-06-11 18:29:33 +05:30
|
|
|
|
|
|
|
|
|
public float Progress;
|
|
|
|
|
|
|
|
|
|
public event Action<float> DownloadProgressed;
|
|
|
|
|
|
2019-06-12 13:30:23 +09:00
|
|
|
|
protected ArchiveDownloadRequest(TModel model)
|
2019-06-11 18:29:33 +05:30
|
|
|
|
{
|
2019-06-12 21:56:36 +05:30
|
|
|
|
Model = model;
|
2019-06-11 18:29:33 +05:30
|
|
|
|
|
|
|
|
|
Progressed += (current, total) => DownloadProgressed?.Invoke(Progress = (float)current / total);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|