mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 00:09:55 +09:00
Implement IEquatable on ControlPoint
This commit is contained in:
@ -1,8 +1,7 @@
|
||||
// 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.Audio;
|
||||
using osu.Game.Graphics;
|
||||
@ -13,7 +12,7 @@ namespace osu.Game.Beatmaps.ControlPoints
|
||||
/// <remarks>
|
||||
/// Note that going forward, this control point type should always be assigned directly to HitObjects.
|
||||
/// </remarks>
|
||||
public class SampleControlPoint : ControlPoint
|
||||
public class SampleControlPoint : ControlPoint, IEquatable<SampleControlPoint>
|
||||
{
|
||||
public const string DEFAULT_BANK = "normal";
|
||||
|
||||
@ -85,5 +84,16 @@ namespace osu.Game.Beatmaps.ControlPoints
|
||||
|
||||
base.CopyFrom(other);
|
||||
}
|
||||
|
||||
public override bool Equals(ControlPoint? other)
|
||||
=> other is SampleControlPoint otherSampleControlPoint
|
||||
&& Equals(otherSampleControlPoint);
|
||||
|
||||
public bool Equals(SampleControlPoint? other)
|
||||
=> base.Equals(other)
|
||||
&& SampleBank == other.SampleBank
|
||||
&& SampleVolume == other.SampleVolume;
|
||||
|
||||
public override int GetHashCode() => HashCode.Combine(base.GetHashCode(), SampleBank, SampleVolume);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user