1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 12:47:25 +08:00

Merge pull request #1102 from swoolcock/make-rulesetinfo-iequatable

Fix RulesetInfo equality comparison giving false negatives
This commit is contained in:
Dan Balasescu 2017-08-18 15:17:50 +09:00 committed by GitHub
commit 9cda37a386

View File

@ -6,7 +6,7 @@ using SQLite.Net.Attributes;
namespace osu.Game.Rulesets
{
public class RulesetInfo
public class RulesetInfo : IEquatable<RulesetInfo>
{
[PrimaryKey, AutoIncrement]
public int? ID { get; set; }
@ -21,5 +21,7 @@ namespace osu.Game.Rulesets
public bool Available { get; set; }
public virtual Ruleset CreateInstance() => (Ruleset)Activator.CreateInstance(Type.GetType(InstantiationInfo), this);
public bool Equals(RulesetInfo other) => other != null && ID == other.ID && Available == other.Available && Name == other.Name && InstantiationInfo == other.InstantiationInfo;
}
}
}