mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 16:59:53 +09:00
Replace local Equatable implementations with abstract EquivalentTo
This commit is contained in:
@ -5,7 +5,7 @@ using System;
|
||||
|
||||
namespace osu.Game.Beatmaps.ControlPoints
|
||||
{
|
||||
public class ControlPoint : IComparable<ControlPoint>, IEquatable<ControlPoint>
|
||||
public abstract class ControlPoint : IComparable<ControlPoint>, IEquatable<ControlPoint>
|
||||
{
|
||||
/// <summary>
|
||||
/// The time at which the control point takes effect.
|
||||
@ -19,7 +19,13 @@ namespace osu.Game.Beatmaps.ControlPoints
|
||||
|
||||
public int CompareTo(ControlPoint other) => Time.CompareTo(other.Time);
|
||||
|
||||
public bool Equals(ControlPoint other)
|
||||
=> Time.Equals(other?.Time);
|
||||
/// <summary>
|
||||
/// Whether this control point is equivalent to another, ignoring time.
|
||||
/// </summary>
|
||||
/// <param name="other">Another control point to compare with.</param>
|
||||
/// <returns>Whether equivalent.</returns>
|
||||
public abstract bool EquivalentTo(ControlPoint other);
|
||||
|
||||
public bool Equals(ControlPoint other) => Time.Equals(other?.Time) && EquivalentTo(other);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user