mirror of
https://github.com/osukey/osukey.git
synced 2025-08-03 06:36:31 +09:00
Implement equality comparers for HitSampleInfo
This commit is contained in:
@ -1,6 +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.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using osu.Framework.Utils;
|
||||
using osu.Game.Audio;
|
||||
@ -50,16 +51,24 @@ namespace osu.Game.Rulesets.Catch.Objects
|
||||
}
|
||||
}
|
||||
|
||||
private class BananaHitSampleInfo : HitSampleInfo
|
||||
private class BananaHitSampleInfo : HitSampleInfo, IEquatable<BananaHitSampleInfo>
|
||||
{
|
||||
private static string[] lookupNames { get; } = { "metronomelow", "catch-banana" };
|
||||
private static readonly string[] lookup_names = { "metronomelow", "catch-banana" };
|
||||
|
||||
public override IEnumerable<string> LookupNames => lookupNames;
|
||||
public override IEnumerable<string> LookupNames => lookup_names;
|
||||
|
||||
public BananaHitSampleInfo()
|
||||
: base(string.Empty)
|
||||
{
|
||||
}
|
||||
|
||||
public bool Equals(BananaHitSampleInfo other)
|
||||
=> other != null;
|
||||
|
||||
public override bool Equals(object obj)
|
||||
=> Equals((BananaHitSampleInfo)obj);
|
||||
|
||||
public override int GetHashCode() => lookup_names.GetHashCode();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user