mirror of
https://github.com/ppy/osu
synced 2025-01-09 23:59:44 +00:00
Add hash code support for Mod
This commit is contained in:
parent
4fb6f5c5ed
commit
060ba0692d
@ -197,6 +197,18 @@ namespace osu.Game.Rulesets.Mods
|
|||||||
ModUtils.GetSettingUnderlyingValue(pair.Item2.GetValue(other))));
|
ModUtils.GetSettingUnderlyingValue(pair.Item2.GetValue(other))));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override int GetHashCode()
|
||||||
|
{
|
||||||
|
var hashCode = new HashCode();
|
||||||
|
|
||||||
|
hashCode.Add(GetType());
|
||||||
|
|
||||||
|
foreach (var (_, prop) in this.GetSettingsSourceProperties())
|
||||||
|
hashCode.Add(ModUtils.GetSettingUnderlyingValue(prop.GetValue(this)));
|
||||||
|
|
||||||
|
return hashCode.ToHashCode();
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Reset all custom settings for this mod back to their defaults.
|
/// Reset all custom settings for this mod back to their defaults.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
Loading…
Reference in New Issue
Block a user