mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 08:20:00 +09:00
Implement IEquatable on ControlPoint
This commit is contained in:
@ -1,15 +1,14 @@
|
||||
// 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.
|
||||
|
||||
#nullable disable
|
||||
|
||||
using System;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Game.Graphics;
|
||||
using osuTK.Graphics;
|
||||
|
||||
namespace osu.Game.Beatmaps.ControlPoints
|
||||
{
|
||||
public class EffectControlPoint : ControlPoint
|
||||
public class EffectControlPoint : ControlPoint, IEquatable<EffectControlPoint>
|
||||
{
|
||||
public static readonly EffectControlPoint DEFAULT = new EffectControlPoint
|
||||
{
|
||||
@ -83,5 +82,17 @@ namespace osu.Game.Beatmaps.ControlPoints
|
||||
|
||||
base.CopyFrom(other);
|
||||
}
|
||||
|
||||
public override bool Equals(ControlPoint? other)
|
||||
=> other is EffectControlPoint otherEffectControlPoint
|
||||
&& Equals(otherEffectControlPoint);
|
||||
|
||||
public bool Equals(EffectControlPoint? other)
|
||||
=> base.Equals(other)
|
||||
&& OmitFirstBarLine == other.OmitFirstBarLine
|
||||
&& ScrollSpeed == other.ScrollSpeed
|
||||
&& KiaiMode == other.KiaiMode;
|
||||
|
||||
public override int GetHashCode() => HashCode.Combine(base.GetHashCode(), OmitFirstBarLine, ScrollSpeed, KiaiMode);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user