mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 17:47:29 +08:00
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 @@ 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,10 @@ 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)
|
||||
{
|
||||
return this.ID == other.ID && this.Available == other.Available && this.Name == other.Name && this.InstantiationInfo == other.InstantiationInfo;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user