Add back track loaded bool in WorkingBeatmap

This commit is contained in:
Dean Herbert 2020-08-21 13:53:12 +09:00
parent 05b402132e
commit 526f06be4c

View File

@ -275,6 +275,11 @@ namespace osu.Game.Beatmaps
/// <param name="track">The track to transfer.</param>
public void TransferTrack([NotNull] Track track) => loadedTrack = track ?? throw new ArgumentNullException(nameof(track));
/// <summary>
/// Whether this beatmap's track has been loaded via <see cref="LoadTrack"/>.
/// </summary>
public bool TrackLoaded => loadedTrack != null;
/// <summary>
/// Get the loaded audio track instance. <see cref="LoadTrack"/> must have first been called.
/// This generally happens via MusicController when changing the global beatmap.
@ -283,7 +288,7 @@ namespace osu.Game.Beatmaps
{
get
{
if (loadedTrack == null)
if (!TrackLoaded)
throw new InvalidOperationException($"Cannot access {nameof(Track)} without first calling {nameof(LoadTrack)}.");
return loadedTrack;