Make RulesetInfo implement IEquatable since EqualityComparer was sometimes giving false negatives and causing Bindable observers to fire

This commit is contained in:
Shane Woolcock 2017-08-13 15:03:01 +09:30
parent 07487b5ca9
commit d19c8f56be
1 changed files with 6 additions and 1 deletions

View File

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