mirror of https://github.com/ppy/osu
Make RulesetInfo implement IEquatable since EqualityComparer was sometimes giving false negatives and causing Bindable observers to fire
This commit is contained in:
parent
07487b5ca9
commit
d19c8f56be
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue