1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 20:22:55 +08:00

Use more of the properties

This commit is contained in:
smoogipoo 2017-11-17 22:10:24 +09:00
parent 1a6b0f5b3f
commit 4ced1b6490

View File

@ -80,10 +80,10 @@ namespace osu.Game.Beatmaps
public void TransferTo(WorkingBeatmap other) public void TransferTo(WorkingBeatmap other)
{ {
if (track.IsValueCreated && track.Value != null && BeatmapInfo.AudioEquals(other.BeatmapInfo)) if (track.IsValueCreated && Track != null && BeatmapInfo.AudioEquals(other.BeatmapInfo))
other.track = track; other.track = track;
if (background.IsValueCreated && background.Value != null && BeatmapInfo.BackgroundEquals(other.BeatmapInfo)) if (background.IsValueCreated && Background != null && BeatmapInfo.BackgroundEquals(other.BeatmapInfo))
other.background = background; other.background = background;
} }
@ -95,15 +95,12 @@ namespace osu.Game.Beatmaps
public void DisposeTrack() public void DisposeTrack()
{ {
if (!track.IsValueCreated) return; if (TrackLoaded) Track.Dispose();
track.Value?.Dispose();
track = null;
} }
private void applyRateAdjustments(Track t = null) private void applyRateAdjustments(Track t = null)
{ {
if (t == null && track.IsValueCreated) t = track.Value; if (t == null && track.IsValueCreated) t = Track;
if (t == null) return; if (t == null) return;
t.ResetSpeedAdjustments(); t.ResetSpeedAdjustments();