1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-13 08:32:57 +08:00

Implement UnbindFrom()

This commit is contained in:
smoogipoo 2021-07-12 17:33:29 +09:00
parent 242982730f
commit 4b393209ec

View File

@ -115,6 +115,17 @@ namespace osu.Game.Rulesets.Mods
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 };
}
}