// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. #nullable disable using System; using osu.Game.Online.API; namespace osu.Game.Database { /// /// Represents a that can download new models from an external source. /// /// The item's interface type. public interface IModelDownloader : IPostNotifications where T : class { /// /// Fired when a download begins. /// This is NOT run on the update thread and should be scheduled. /// event Action> DownloadBegan; /// /// Fired when a download is interrupted, either due to user cancellation or failure. /// This is NOT run on the update thread and should be scheduled. /// event Action> DownloadFailed; /// /// Begin a download for the requested . /// /// The to be downloaded. /// Whether this download should be optimised for slow connections. Generally means extras are not included in the download bundle.. /// Whether the download was started. bool Download(T item, bool minimiseDownloadSize); /// /// Gets an existing download request if it exists. /// /// The whose request is wanted. /// The object if it exists, otherwise null. ArchiveDownloadRequest GetExistingDownload(T item); } }