mirror of
https://github.com/ppy/osu.git
synced 2025-01-28 06:42:54 +08: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>
|
/// <param name="track">The track to transfer.</param>
|
||||||
public void TransferTrack([NotNull] Track track) => loadedTrack = track ?? throw new ArgumentNullException(nameof(track));
|
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>
|
/// <summary>
|
||||||
/// Get the loaded audio track instance. <see cref="LoadTrack"/> must have first been called.
|
/// Get the loaded audio track instance. <see cref="LoadTrack"/> must have first been called.
|
||||||
/// This generally happens via MusicController when changing the global beatmap.
|
/// This generally happens via MusicController when changing the global beatmap.
|
||||||
@ -283,7 +288,7 @@ namespace osu.Game.Beatmaps
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
if (loadedTrack == null)
|
if (!TrackLoaded)
|
||||||
throw new InvalidOperationException($"Cannot access {nameof(Track)} without first calling {nameof(LoadTrack)}.");
|
throw new InvalidOperationException($"Cannot access {nameof(Track)} without first calling {nameof(LoadTrack)}.");
|
||||||
|
|
||||||
return loadedTrack;
|
return loadedTrack;
|
||||||
|
Loading…
Reference in New Issue
Block a user