1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-28 06:42:54 +08:00

Default CreateSpeedAdjustmentContainer implementation.

This commit is contained in:
smoogipooo 2017-08-07 15:22:31 +09:00
parent c6447e40f9
commit 068dfcb19a
2 changed files with 5 additions and 2 deletions

View File

@ -48,7 +48,7 @@ namespace osu.Game.Rulesets.Timing
/// Creates a new <see cref="SpeedAdjustmentContainer"/>.
/// </summary>
/// <param name="controlPoint">The <see cref="MultiplierControlPoint"/> which provides the speed adjustments for this container.</param>
protected SpeedAdjustmentContainer(MultiplierControlPoint controlPoint)
public SpeedAdjustmentContainer(MultiplierControlPoint controlPoint)
{
ControlPoint = controlPoint;

View File

@ -86,6 +86,9 @@ namespace osu.Game.Rulesets.UI
.GroupBy(s => s.TimingPoint.BeatLength * s.DifficultyPoint.SpeedMultiplier).Select(g => g.First());
DefaultControlPoints.AddRange(timingChanges);
if (DefaultControlPoints.Count == 0)
DefaultControlPoints.Add(new MultiplierControlPoint());
}
/// <summary>
@ -105,6 +108,6 @@ namespace osu.Game.Rulesets.UI
return new MultiplierControlPoint(time, DefaultControlPoints[index].DeepClone());
}
protected abstract SpeedAdjustmentContainer CreateSpeedAdjustmentContainer(MultiplierControlPoint controlPoint);
protected virtual SpeedAdjustmentContainer CreateSpeedAdjustmentContainer(MultiplierControlPoint controlPoint) => new SpeedAdjustmentContainer(controlPoint);
}
}