2019-01-24 08:43:03 +00:00
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
2018-04-13 09:19:50 +00:00
using System ;
using osu.Game.Beatmaps.ControlPoints ;
namespace osu.Game.Rulesets.Timing
{
/// <summary>
2021-09-01 09:19:25 +00:00
/// A control point which adds an aggregated multiplier based on the provided <see cref="TimingPoint"/>'s BeatLength and <see cref="EffectPoint"/>'s SpeedMultiplier.
2018-04-13 09:19:50 +00:00
/// </summary>
2021-08-31 05:38:35 +00:00
public class MultiplierControlPoint : IComparable < MultiplierControlPoint >
2018-04-13 09:19:50 +00:00
{
/// <summary>
/// The time in milliseconds at which this <see cref="MultiplierControlPoint"/> starts.
/// </summary>
public double StartTime ;
/// <summary>
2018-10-01 09:12:26 +00:00
/// The aggregate multiplier which this <see cref="MultiplierControlPoint"/> provides.
2018-04-13 09:19:50 +00:00
/// </summary>
2021-09-06 05:56:34 +00:00
public double Multiplier = > Velocity * EffectPoint . ScrollSpeed * BaseBeatLength / TimingPoint . BeatLength ;
2019-08-26 03:51:13 +00:00
/// <summary>
/// The base beat length to scale the <see cref="TimingPoint"/> provided multiplier relative to.
/// </summary>
/// <example>For a <see cref="BaseBeatLength"/> of 1000, a <see cref="TimingPoint"/> with a beat length of 500 will increase the multiplier by 2.</example>
2019-08-28 11:22:16 +00:00
public double BaseBeatLength = TimingControlPoint . DEFAULT_BEAT_LENGTH ;
2018-10-01 09:12:26 +00:00
/// <summary>
/// The velocity multiplier.
/// </summary>
public double Velocity = 1 ;
2018-04-13 09:19:50 +00:00
/// <summary>
/// The <see cref="TimingControlPoint"/> that provides the timing information for this <see cref="MultiplierControlPoint"/>.
/// </summary>
public TimingControlPoint TimingPoint = new TimingControlPoint ( ) ;
/// <summary>
2021-09-01 09:19:25 +00:00
/// The <see cref="EffectControlPoint"/> that provides additional difficulty information for this <see cref="MultiplierControlPoint"/>.
2018-04-13 09:19:50 +00:00
/// </summary>
2021-09-01 09:19:25 +00:00
public EffectControlPoint EffectPoint = new EffectControlPoint ( ) ;
2018-04-13 09:19:50 +00:00
/// <summary>
/// Creates a <see cref="MultiplierControlPoint"/>. This is required for JSON serialization
/// </summary>
public MultiplierControlPoint ( )
{
}
/// <summary>
/// Creates a <see cref="MultiplierControlPoint"/>.
/// </summary>
/// <param name="startTime">The start time of this <see cref="MultiplierControlPoint"/>.</param>
public MultiplierControlPoint ( double startTime )
{
StartTime = startTime ;
}
// ReSharper disable once ImpureMethodCallOnReadonlyValueField
public int CompareTo ( MultiplierControlPoint other ) = > StartTime . CompareTo ( other ? . StartTime ) ;
}
}