Merge branch 'master' into remove-stupid-weak-reference-bindable-events

This commit is contained in:
Dean Herbert
2021-11-06 13:57:34 +09:00
13 changed files with 76 additions and 94 deletions

View File

@ -9,35 +9,35 @@ namespace osu.Game.Database
/// <summary>
/// Represents a <see cref="IModelManager{TModel}"/> that can download new models from an external source.
/// </summary>
/// <typeparam name="TModel">The model type.</typeparam>
public interface IModelDownloader<TModel> : IPostNotifications
where TModel : class
/// <typeparam name="T">The item's interface type.</typeparam>
public interface IModelDownloader<T> : IPostNotifications
where T : class
{
/// <summary>
/// Fired when a <typeparamref name="TModel"/> download begins.
/// Fired when a <typeparamref name="T"/> download begins.
/// This is NOT run on the update thread and should be scheduled.
/// </summary>
Action<ArchiveDownloadRequest<TModel>> DownloadBegan { get; set; }
Action<ArchiveDownloadRequest<T>> DownloadBegan { get; set; }
/// <summary>
/// Fired when a <typeparamref name="TModel"/> download is interrupted, either due to user cancellation or failure.
/// Fired when a <typeparamref name="T"/> download is interrupted, either due to user cancellation or failure.
/// This is NOT run on the update thread and should be scheduled.
/// </summary>
Action<ArchiveDownloadRequest<TModel>> DownloadFailed { get; set; }
Action<ArchiveDownloadRequest<T>> DownloadFailed { get; set; }
/// <summary>
/// Begin a download for the requested <typeparamref name="TModel"/>.
/// Begin a download for the requested <typeparamref name="T"/>.
/// </summary>
/// <param name="model">The <stypeparamref name="TModel"/> to be downloaded.</param>
/// <param name="item">The <stypeparamref name="T"/> to be downloaded.</param>
/// <param name="minimiseDownloadSize">Whether this download should be optimised for slow connections. Generally means extras are not included in the download bundle..</param>
/// <returns>Whether the download was started.</returns>
bool Download(TModel model, bool minimiseDownloadSize);
bool Download(T item, bool minimiseDownloadSize);
/// <summary>
/// Gets an existing <typeparamref name="TModel"/> download request if it exists.
/// Gets an existing <typeparamref name="T"/> download request if it exists.
/// </summary>
/// <param name="model">The <typeparamref name="TModel"/> whose request is wanted.</param>
/// <returns>The <see cref="ArchiveDownloadRequest{TModel}"/> object if it exists, otherwise null.</returns>
ArchiveDownloadRequest<TModel> GetExistingDownload(TModel model);
/// <param name="item">The <typeparamref name="T"/> whose request is wanted.</param>
/// <returns>The <see cref="ArchiveDownloadRequest{T}"/> object if it exists, otherwise null.</returns>
ArchiveDownloadRequest<T> GetExistingDownload(T item);
}
}