1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-30 11:17:25 +08:00
osu-lazer/osu.Game/Beatmaps/ControlPoints/ControlPoint.cs

30 lines
1.2 KiB
C#
Raw Normal View History

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);
/// <summary>
/// Whether this <see cref="ControlPoint"/> provides the same changes to gameplay as another <see cref="ControlPoint"/>.
/// </summary>
/// <param name="other">The <see cref="ControlPoint"/> to compare to.</param>
/// <returns>Whether this <see cref="ControlPoint"/> provides the same changes to gameplay as <paramref name="other"/>.</returns>
public virtual bool ChangeEquals(ControlPoint other) => !ReferenceEquals(null, other);
public bool Equals(ControlPoint other)
=> ChangeEquals(other)
2018-07-02 12:51:47 +08:00
&& !ReferenceEquals(null, other)
&& Time.Equals(other.Time);
2018-04-13 17:19:50 +08:00
}
}