2020-04-27 15:13:28 +08:00
|
|
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
|
|
|
// See the LICENCE file in the repository root for full licence text.
|
|
|
|
|
|
|
|
using osu.Game.Rulesets.Taiko.Objects.Drawables;
|
|
|
|
using osu.Game.Rulesets.UI.Scrolling;
|
|
|
|
|
|
|
|
namespace osu.Game.Rulesets.Taiko.UI
|
|
|
|
{
|
|
|
|
internal partial class DrumRollHitContainer : ScrollingHitObjectContainer
|
|
|
|
{
|
2021-05-31 22:00:12 +08:00
|
|
|
// TODO: this usage is buggy.
|
|
|
|
// Because `LifetimeStart` is set based on scrolling, lifetime is not same as the time when the object is created.
|
|
|
|
// If the `Update` override is removed, it breaks in an obscure way.
|
|
|
|
protected override bool RemoveRewoundEntry => true;
|
|
|
|
|
2020-04-27 15:13:28 +08:00
|
|
|
protected override void Update()
|
|
|
|
{
|
|
|
|
base.Update();
|
|
|
|
|
|
|
|
// Remove any auxiliary hit notes that were spawned during a drum roll but subsequently rewound.
|
2021-10-27 12:04:41 +08:00
|
|
|
for (int i = AliveInternalChildren.Count - 1; i >= 0; i--)
|
2020-04-27 15:13:28 +08:00
|
|
|
{
|
|
|
|
var flyingHit = (DrawableFlyingHit)AliveInternalChildren[i];
|
2020-04-27 15:48:17 +08:00
|
|
|
if (Time.Current <= flyingHit.HitObject.StartTime)
|
2020-04-27 15:13:28 +08:00
|
|
|
Remove(flyingHit);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|