mirror of https://github.com/ppy/osu
Implement UnbindFrom()
This commit is contained in:
parent
242982730f
commit
4b393209ec
|
@ -115,6 +115,17 @@ public override void BindTo(Bindable<float?> them)
|
|||
ExtendedMaxValue = otherDifficultyBindable.extendedMaxValue;
|
||||
}
|
||||
|
||||
public override void UnbindFrom(IUnbindable them)
|
||||
{
|
||||
if (!(them is DifficultyBindable otherDifficultyBindable))
|
||||
throw new InvalidOperationException($"Cannot unbind from a non-{nameof(DifficultyBindable)}.");
|
||||
|
||||
base.UnbindFrom(them);
|
||||
|
||||
CurrentNumber.UnbindFrom(otherDifficultyBindable.CurrentNumber);
|
||||
ExtendedLimits.UnbindFrom(otherDifficultyBindable.ExtendedLimits);
|
||||
}
|
||||
|
||||
public new DifficultyBindable GetBoundCopy() => new DifficultyBindable { BindTarget = this };
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue