1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-29 06:09:59 +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
Unverified
+4 -2
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;
}
}
}