mirror of
https://github.com/ppy/osu.git
synced 2025-01-12 17:43:05 +08:00
Add missing equality implementations on IRulesetInfo
This commit is contained in:
parent
675ecb603f
commit
15db1372aa
@ -50,6 +50,8 @@ namespace osu.Game.Models
|
|||||||
|
|
||||||
public bool Equals(RealmRuleset? other) => other != null && OnlineID == other.OnlineID && Available == other.Available && Name == other.Name && InstantiationInfo == other.InstantiationInfo;
|
public bool Equals(RealmRuleset? other) => other != null && OnlineID == other.OnlineID && Available == other.Available && Name == other.Name && InstantiationInfo == other.InstantiationInfo;
|
||||||
|
|
||||||
|
public bool Equals(IRulesetInfo? other) => other is RealmRuleset b && Equals(b);
|
||||||
|
|
||||||
public override string ToString() => Name;
|
public override string ToString() => Name;
|
||||||
|
|
||||||
public RealmRuleset Clone() => new RealmRuleset
|
public RealmRuleset Clone() => new RealmRuleset
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// 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.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
|
using System;
|
||||||
using osu.Game.Database;
|
using osu.Game.Database;
|
||||||
|
|
||||||
#nullable enable
|
#nullable enable
|
||||||
@ -10,7 +11,7 @@ namespace osu.Game.Rulesets
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A representation of a ruleset's metadata.
|
/// A representation of a ruleset's metadata.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public interface IRulesetInfo : IHasOnlineID<int>
|
public interface IRulesetInfo : IHasOnlineID<int>, IEquatable<IRulesetInfo>
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The user-exposed name of this ruleset.
|
/// The user-exposed name of this ruleset.
|
||||||
|
@ -49,6 +49,8 @@ namespace osu.Game.Rulesets
|
|||||||
|
|
||||||
public override bool Equals(object obj) => obj is RulesetInfo rulesetInfo && Equals(rulesetInfo);
|
public override bool Equals(object obj) => obj is RulesetInfo rulesetInfo && Equals(rulesetInfo);
|
||||||
|
|
||||||
|
public bool Equals(IRulesetInfo other) => other is RulesetInfo b && Equals(b);
|
||||||
|
|
||||||
[SuppressMessage("ReSharper", "NonReadonlyMemberInGetHashCode")]
|
[SuppressMessage("ReSharper", "NonReadonlyMemberInGetHashCode")]
|
||||||
public override int GetHashCode()
|
public override int GetHashCode()
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user