Fix mod using reference equality unless casted to IMod

This commit is contained in:
Salman Ahmed
2020-12-27 02:42:13 +03:00
parent 6849eabf2c
commit 43f8f3638a
4 changed files with 7 additions and 8 deletions

View File

@ -1,12 +1,11 @@
// 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 Newtonsoft.Json;
namespace osu.Game.Rulesets.Mods
{
public interface IMod : IEquatable<IMod>
public interface IMod
{
/// <summary>
/// The shortened name of this mod.

View File

@ -20,7 +20,7 @@ namespace osu.Game.Rulesets.Mods
/// The base class for gameplay modifiers.
/// </summary>
[ExcludeFromDynamicCompile]
public abstract class Mod : IMod, IJsonSerializable
public abstract class Mod : IMod, IEquatable<Mod>, IJsonSerializable
{
/// <summary>
/// The name of this mod.
@ -149,6 +149,6 @@ namespace osu.Game.Rulesets.Mods
return copy;
}
public bool Equals(IMod other) => GetType() == other?.GetType();
public bool Equals(Mod other) => GetType() == other?.GetType();
}
}