Fix incorrect equality check when TimingPointAt returns a default T

This commit is contained in:
Dean Herbert
2017-07-18 17:45:27 +09:00
parent 21984ba764
commit 007b343854
2 changed files with 13 additions and 4 deletions

View File

@ -5,7 +5,7 @@ using System;
namespace osu.Game.Beatmaps.ControlPoints
{
public class ControlPoint : IComparable<ControlPoint>
public class ControlPoint : IComparable<ControlPoint>, IEquatable<ControlPoint>
{
/// <summary>
/// The time at which the control point takes effect.
@ -13,5 +13,12 @@ namespace osu.Game.Beatmaps.ControlPoints
public double Time;
public int CompareTo(ControlPoint other) => Time.CompareTo(other.Time);
public bool Equals(ControlPoint other)
{
if (ReferenceEquals(null, other)) return false;
if (ReferenceEquals(this, other)) return true;
return Time.Equals(other.Time);
}
}
}