1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 17:07:38 +08:00

Make BeatmapAvailability class in-line with other online data structures

This commit is contained in:
Salman Ahmed 2021-01-03 18:34:11 +03:00
parent dfa8be9173
commit 152e9ecccf
2 changed files with 3 additions and 3 deletions

View File

@ -20,7 +20,7 @@ namespace osu.Game.Online.Multiplayer
/// <summary>
/// The availability state of the beatmap, set to <see cref="DownloadState.LocallyAvailable"/> by default.
/// </summary>
public BeatmapAvailability BeatmapAvailability { get; set; } = new BeatmapAvailability(DownloadState.LocallyAvailable);
public BeatmapAvailability BeatmapAvailability { get; set; } = BeatmapAvailability.LocallyAvailable();
public User? User { get; set; }

View File

@ -8,7 +8,7 @@ namespace osu.Game.Online.Rooms
/// <summary>
/// The local availability information about a certain beatmap for the client.
/// </summary>
public readonly struct BeatmapAvailability : IEquatable<BeatmapAvailability>
public class BeatmapAvailability : IEquatable<BeatmapAvailability>
{
/// <summary>
/// The beatmap's availability state.
@ -49,7 +49,7 @@ namespace osu.Game.Online.Rooms
DownloadProgress = downloadProgress;
}
public bool Equals(BeatmapAvailability other) => State == other.State && DownloadProgress == other.DownloadProgress;
public bool Equals(BeatmapAvailability other) => other != null && State == other.State && DownloadProgress == other.DownloadProgress;
public override string ToString() => $"{string.Join(", ", State, $"{DownloadProgress:0.00%}")}";
}