Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix RulesetInfo equality comparison giving false negatives #1102

Merged
merged 4 commits into from Aug 18, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 6 additions & 1 deletion osu.Game/Rulesets/RulesetInfo.cs
Expand Up @@ -6,7 +6,7 @@

namespace osu.Game.Rulesets
{
public class RulesetInfo
public class RulesetInfo : IEquatable<RulesetInfo>
{
[PrimaryKey, AutoIncrement]
public int? ID { get; set; }
Expand All @@ -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;
}
}
}