// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using osu.Framework.Bindables; using osu.Framework.Graphics; namespace osu.Game.Online { public abstract partial class DownloadTracker : Component where T : class { public readonly T TrackedItem; /// /// Holds the current download state of the download - whether is has already been downloaded, is in progress, or is not downloaded. /// public IBindable State => state; private readonly Bindable state = new Bindable(); /// /// The progress of an active download. /// public IBindableNumber Progress => progress; private readonly BindableNumber progress = new BindableNumber { MinValue = 0, MaxValue = 1 }; protected DownloadTracker(T trackedItem) { TrackedItem = trackedItem; } protected void UpdateState(DownloadState newState) => state.Value = newState; protected void UpdateProgress(double newProgress) => progress.Value = newProgress; } }