1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-17 17:17:19 +08:00

Centralise and clarify LoadTrack documentation

This commit is contained in:
Dean Herbert 2020-08-22 19:42:34 +09:00
parent f63d1ba612
commit b72f06fef6
2 changed files with 9 additions and 5 deletions

View File

@ -56,8 +56,16 @@ namespace osu.Game.Beatmaps
IBeatmap GetPlayableBeatmap(RulesetInfo ruleset, IReadOnlyList<Mod> mods = null, TimeSpan? timeout = null);
/// <summary>
/// Retrieves the <see cref="Track"/> which this <see cref="WorkingBeatmap"/> provides.
/// Load a new audio track instance for this beatmap. This should be called once before accessing <see cref="Track"/>.
/// The caller of this method is responsible for the lifetime of the track.
/// </summary>
/// <remarks>
/// In a standard game context, the loading of the track is managed solely by MusicController, which will
/// automatically load the track of the current global IBindable WorkingBeatmap.
/// As such, this method should only be called in very special scenarios, such as external tests or apps which are
/// outside of the game context.
/// </remarks>
/// <returns>A fresh track instance, which will also be available via <see cref="Track"/>.</returns>
Track LoadTrack();
}
}

View File

@ -261,10 +261,6 @@ namespace osu.Game.Beatmaps
private Track loadedTrack;
/// <summary>
/// Load a new audio track instance for this beatmap.
/// </summary>
/// <returns>A fresh track instance, which will also be available via <see cref="Track"/>.</returns>
[NotNull]
public Track LoadTrack() => loadedTrack = GetBeatmapTrack() ?? GetVirtualTrack(1000);