1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 10:33:30 +08:00

Implement HitObjectContainer.Clear()

This commit is contained in:
smoogipoo 2020-04-23 11:16:59 +09:00
parent 97dcd546f1
commit 86ef73aa27
2 changed files with 17 additions and 0 deletions

View File

@ -43,6 +43,15 @@ namespace osu.Game.Rulesets.UI
return true;
}
public virtual void Clear(bool disposeChildren = true)
{
ClearInternal(disposeChildren);
foreach (var kvp in startTimeMap)
kvp.Value.bindable.UnbindAll();
startTimeMap.Clear();
}
public int IndexOf(DrawableHitObject hitObject) => IndexOfInternal(hitObject);
private void onStartTimeChanged(DrawableHitObject hitObject)

View File

@ -58,6 +58,14 @@ namespace osu.Game.Rulesets.UI.Scrolling
return result;
}
public override void Clear(bool disposeChildren = true)
{
base.Clear(disposeChildren);
initialStateCache.Invalidate();
hitObjectInitialStateCache.Clear();
}
private float scrollLength;
protected override void Update()