// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using System; using osu.Game.Beatmaps.ControlPoints; using osu.Game.IO.Serialization; namespace osu.Game.Rulesets.Timing { /// /// A control point which adds an aggregated multiplier based on the provided 's BeatLength and 's SpeedMultiplier. /// public class MultiplierControlPoint : IJsonSerializable, IComparable { /// /// The time in milliseconds at which this starts. /// public double StartTime; /// /// The aggregate multiplier which this provides. /// public double Multiplier => Velocity * DifficultyPoint.SpeedMultiplier * 1000 / TimingPoint.BeatLength; /// /// The velocity multiplier. /// public double Velocity = 1; /// /// The that provides the timing information for this . /// public TimingControlPoint TimingPoint = new TimingControlPoint(); /// /// The that provides additional difficulty information for this . /// public DifficultyControlPoint DifficultyPoint = new DifficultyControlPoint(); /// /// Creates a . This is required for JSON serialization /// public MultiplierControlPoint() { } /// /// Creates a . /// /// The start time of this . public MultiplierControlPoint(double startTime) { StartTime = startTime; } // ReSharper disable once ImpureMethodCallOnReadonlyValueField public int CompareTo(MultiplierControlPoint other) => StartTime.CompareTo(other?.StartTime); } }