mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 13:37:25 +08:00
Rename parameters for readability
This commit is contained in:
parent
2501707d7d
commit
a3e29b9154
@ -148,18 +148,18 @@ namespace osu.Game.Rulesets.Mods
|
||||
/// When creating copies or clones of a Mod, this method will be called to copy explicitly adjusted user settings.
|
||||
/// The base implementation will transfer the value via <see cref="Bindable{T}.Parse"/> and should be called unless replaced with custom logic.
|
||||
/// </summary>
|
||||
/// <param name="bindable">The target bindable to apply the adjustment.</param>
|
||||
/// <param name="value">The adjustment to apply.</param>
|
||||
internal virtual void CopyAdjustedSetting(IBindable bindable, object value)
|
||||
/// <param name="target">The target bindable to apply the adjustment.</param>
|
||||
/// <param name="source">The adjustment to apply.</param>
|
||||
internal virtual void CopyAdjustedSetting(IBindable target, object source)
|
||||
{
|
||||
if (value is IBindable incoming)
|
||||
if (source is IBindable sourceBindable)
|
||||
{
|
||||
//copy including transfer of default values.
|
||||
bindable.BindTo(incoming);
|
||||
bindable.UnbindFrom(incoming);
|
||||
target.BindTo(sourceBindable);
|
||||
target.UnbindFrom(sourceBindable);
|
||||
}
|
||||
else
|
||||
bindable.Parse(value);
|
||||
target.Parse(source);
|
||||
}
|
||||
|
||||
public bool Equals(IMod other) => GetType() == other?.GetType();
|
||||
|
@ -114,10 +114,10 @@ namespace osu.Game.Rulesets.Mods
|
||||
bindable.ValueChanged += _ => userChangedSettings[bindable] = !bindable.IsDefault;
|
||||
}
|
||||
|
||||
internal override void CopyAdjustedSetting(IBindable bindable, object value)
|
||||
internal override void CopyAdjustedSetting(IBindable target, object source)
|
||||
{
|
||||
userChangedSettings[bindable] = true;
|
||||
base.CopyAdjustedSetting(bindable, value);
|
||||
userChangedSettings[target] = true;
|
||||
base.CopyAdjustedSetting(target, source);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
Loading…
Reference in New Issue
Block a user