mirror of
https://github.com/ppy/osu
synced 2025-02-08 06:07:14 +00:00
Remove equality comparison implementation from BeatmapCard
This turned out to be a hurdle instead as it disallows adding two beatmap cards of equal beatmap, which, while being a good behaviour in client, makes tests more complicated to work.
This commit is contained in:
parent
ac8fb4f9b2
commit
bd512c4937
@ -14,7 +14,7 @@ using osu.Game.Overlays;
|
||||
|
||||
namespace osu.Game.Beatmaps.Drawables.Cards
|
||||
{
|
||||
public abstract class BeatmapCard : OsuClickableContainer, IEquatable<BeatmapCard>
|
||||
public abstract class BeatmapCard : OsuClickableContainer
|
||||
{
|
||||
public const float TRANSITION_DURATION = 400;
|
||||
public const float CORNER_RADIUS = 10;
|
||||
@ -96,16 +96,5 @@ namespace osu.Game.Beatmaps.Drawables.Cards
|
||||
throw new ArgumentOutOfRangeException(nameof(size), size, @"Unsupported card size");
|
||||
}
|
||||
}
|
||||
|
||||
public bool Equals(BeatmapCard? other)
|
||||
{
|
||||
if (ReferenceEquals(null, other)) return false;
|
||||
if (ReferenceEquals(this, other)) return true;
|
||||
|
||||
return BeatmapSet.Equals(other.BeatmapSet);
|
||||
}
|
||||
|
||||
public override bool Equals(object obj) => obj is BeatmapCard other && Equals(other);
|
||||
public override int GetHashCode() => BeatmapSet.GetHashCode();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user