Run all type and sample mutations through standardising methods

This commit is contained in:
Dean Herbert
2021-05-23 20:22:48 +09:00
parent d0d90d77c9
commit dc322d1c63
3 changed files with 49 additions and 20 deletions

View File

@ -33,15 +33,25 @@ namespace osu.Game.Rulesets.Taiko.Objects
public bool IsStrong
{
get => IsStrongBindable.Value;
set
{
IsStrongBindable.Value = value;
updateSamplesFromStrong();
}
set => IsStrongBindable.Value = value;
}
private void updateSamplesFromStrong()
protected TaikoStrongableHitObject()
{
IsStrongBindable.BindValueChanged(_ => UpdateSamplesFromType());
}
protected override void UpdateTypeFromSamples()
{
base.UpdateTypeFromSamples();
IsStrong = getStrongSamples().Any();
}
protected override void UpdateSamplesFromType()
{
base.UpdateSamplesFromType();
var strongSamples = getStrongSamples();
if (IsStrongBindable.Value != strongSamples.Any())