// Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE 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 readonly double StartTime; /// /// The multiplier which this provides. /// public double Multiplier => 1000 / TimingPoint.BeatLength * DifficultyPoint.SpeedMultiplier; /// /// 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; } /// /// Creates a by copying another . /// /// The start time of this . /// The to copy. public MultiplierControlPoint(double startTime, MultiplierControlPoint other) : this(startTime) { TimingPoint = other.TimingPoint; DifficultyPoint = other.DifficultyPoint; } public int CompareTo(MultiplierControlPoint other) => StartTime.CompareTo(other?.StartTime); } }