mirror of
https://github.com/ppy/osu
synced 2025-01-02 20:32:10 +00:00
Add back track loaded bool in WorkingBeatmap
This commit is contained in:
parent
05b402132e
commit
526f06be4c
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user