Rename parameters for readability

This commit is contained in:
Bartłomiej Dach 2021-01-03 13:25:44 +01:00
parent 2501707d7d
commit a3e29b9154
2 changed files with 10 additions and 10 deletions

View File

@ -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. /// 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. /// The base implementation will transfer the value via <see cref="Bindable{T}.Parse"/> and should be called unless replaced with custom logic.
/// </summary> /// </summary>
/// <param name="bindable">The target bindable to apply the adjustment.</param> /// <param name="target">The target bindable to apply the adjustment.</param>
/// <param name="value">The adjustment to apply.</param> /// <param name="source">The adjustment to apply.</param>
internal virtual void CopyAdjustedSetting(IBindable bindable, object value) internal virtual void CopyAdjustedSetting(IBindable target, object source)
{ {
if (value is IBindable incoming) if (source is IBindable sourceBindable)
{ {
//copy including transfer of default values. //copy including transfer of default values.
bindable.BindTo(incoming); target.BindTo(sourceBindable);
bindable.UnbindFrom(incoming); target.UnbindFrom(sourceBindable);
} }
else else
bindable.Parse(value); target.Parse(source);
} }
public bool Equals(IMod other) => GetType() == other?.GetType(); public bool Equals(IMod other) => GetType() == other?.GetType();

View File

@ -114,10 +114,10 @@ namespace osu.Game.Rulesets.Mods
bindable.ValueChanged += _ => userChangedSettings[bindable] = !bindable.IsDefault; 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; userChangedSettings[target] = true;
base.CopyAdjustedSetting(bindable, value); base.CopyAdjustedSetting(target, source);
} }
/// <summary> /// <summary>