2018-04-13 17:19:50 +08:00
|
|
|
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
|
|
|
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
|
|
|
|
|
|
|
|
|
using System;
|
|
|
|
|
|
|
|
|
|
namespace osu.Game.Beatmaps.ControlPoints
|
|
|
|
|
{
|
|
|
|
|
public class ControlPoint : IComparable<ControlPoint>, IEquatable<ControlPoint>
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The time at which the control point takes effect.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public double Time;
|
|
|
|
|
|
|
|
|
|
public int CompareTo(ControlPoint other) => Time.CompareTo(other.Time);
|
|
|
|
|
|
2018-07-02 12:33:59 +08:00
|
|
|
|
/// <summary>
|
2018-07-05 14:00:02 +08:00
|
|
|
|
/// Whether this <see cref="ControlPoint"/> provides the same parametric changes as another <see cref="ControlPoint"/>.
|
|
|
|
|
/// Basically an equality check without considering the <see cref="Time"/>.
|
2018-07-02 12:33:59 +08:00
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="other">The <see cref="ControlPoint"/> to compare to.</param>
|
2018-07-05 14:00:02 +08:00
|
|
|
|
/// <returns>Whether this <see cref="ControlPoint"/> is equivalent to <paramref name="other"/>.</returns>
|
|
|
|
|
public virtual bool EquivalentTo(ControlPoint other) => true;
|
2018-06-28 17:08:46 +08:00
|
|
|
|
|
2018-07-02 12:33:59 +08:00
|
|
|
|
public bool Equals(ControlPoint other)
|
2018-07-05 14:00:02 +08:00
|
|
|
|
=> EquivalentTo(other) && Time.Equals(other?.Time);
|
2018-04-13 17:19:50 +08:00
|
|
|
|
}
|
|
|
|
|
}
|