Enforce float type in the download progress path instead

This commit is contained in:
Salman Ahmed
2021-01-17 21:16:45 +03:00
parent 172552d551
commit d93a853dfd
6 changed files with 17 additions and 17 deletions

View File

@ -19,17 +19,17 @@ namespace osu.Game.Online.Rooms
/// <summary>
/// The beatmap's downloading progress, null when not in <see cref="DownloadState.Downloading"/> state.
/// </summary>
public readonly double? DownloadProgress;
public readonly float? DownloadProgress;
[JsonConstructor]
private BeatmapAvailability(DownloadState state, double? downloadProgress = null)
private BeatmapAvailability(DownloadState state, float? downloadProgress = null)
{
State = state;
DownloadProgress = downloadProgress;
}
public static BeatmapAvailability NotDownloaded() => new BeatmapAvailability(DownloadState.NotDownloaded);
public static BeatmapAvailability Downloading(double progress) => new BeatmapAvailability(DownloadState.Downloading, progress);
public static BeatmapAvailability Downloading(float progress) => new BeatmapAvailability(DownloadState.Downloading, progress);
public static BeatmapAvailability Importing() => new BeatmapAvailability(DownloadState.Importing);
public static BeatmapAvailability LocallyAvailable() => new BeatmapAvailability(DownloadState.LocallyAvailable);

View File

@ -70,7 +70,7 @@ namespace osu.Game.Online.Rooms
break;
case DownloadState.Downloading:
availability.Value = BeatmapAvailability.Downloading(Progress.Value);
availability.Value = BeatmapAvailability.Downloading((float)Progress.Value);
break;
case DownloadState.Importing: