Add DoubleTime, HalfTime and Nightcore support.

This commit is contained in:
Dean Herbert
2017-04-21 17:33:20 +09:00
parent 6e3125e115
commit 3f832731c9
21 changed files with 313 additions and 134 deletions

View File

@ -8,6 +8,7 @@ using osu.Game.Database;
using osu.Game.Rulesets.Mods;
using System;
using System.Collections.Generic;
using System.Linq;
namespace osu.Game.Beatmaps
{
@ -26,6 +27,18 @@ namespace osu.Game.Beatmaps
BeatmapInfo = beatmapInfo;
BeatmapSetInfo = beatmapSetInfo;
WithStoryboard = withStoryboard;
Mods.ValueChanged += mods => applyRateAdjustments();
}
private void applyRateAdjustments()
{
var t = track;
if (t == null) return;
t.ResetRate();
foreach (var mod in Mods.Value.OfType<IApplicableToClock>())
mod.ApplyToClock(t);
}
protected abstract Beatmap GetBeatmap();
@ -66,7 +79,11 @@ namespace osu.Game.Beatmaps
{
lock (trackLock)
{
return track ?? (track = GetTrack());
if (track != null) return track;
track = GetTrack();
applyRateAdjustments();
return track;
}
}
}