mirror of
https://github.com/osukey/osukey.git
synced 2025-07-03 01:09:57 +09:00
Move GetSettingUnderlyingValue
to a SettingSource
extension method
This commit is contained in:
@ -192,7 +192,7 @@ namespace osu.Game.Rulesets.Mods
|
||||
hashCode.Add(GetType());
|
||||
|
||||
foreach (var setting in Settings)
|
||||
hashCode.Add(ModUtils.GetSettingUnderlyingValue(setting));
|
||||
hashCode.Add(setting.GetUnderlyingSettingValue());
|
||||
|
||||
return hashCode.ToHashCode();
|
||||
}
|
||||
@ -208,13 +208,13 @@ namespace osu.Game.Rulesets.Mods
|
||||
|
||||
public bool Equals(IBindable x, IBindable y)
|
||||
{
|
||||
object xValue = x == null ? null : ModUtils.GetSettingUnderlyingValue(x);
|
||||
object yValue = y == null ? null : ModUtils.GetSettingUnderlyingValue(y);
|
||||
object xValue = x?.GetUnderlyingSettingValue();
|
||||
object yValue = y?.GetUnderlyingSettingValue();
|
||||
|
||||
return EqualityComparer<object>.Default.Equals(xValue, yValue);
|
||||
}
|
||||
|
||||
public int GetHashCode(IBindable obj) => ModUtils.GetSettingUnderlyingValue(obj).GetHashCode();
|
||||
public int GetHashCode(IBindable obj) => obj.GetUnderlyingSettingValue().GetHashCode();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user