2023-06-23 01:37:25 +09:00
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
2019-01-24 17:43:03 +09:00
// See the LICENCE file in the repository root for full licence text.
2018-08-03 16:11:57 +09:00
2023-07-15 22:33:16 +07:00
using osu.Game.Rulesets.Objects ;
2018-08-03 16:56:46 +09:00
using osu.Game.Rulesets.Taiko.Judgements ;
2018-08-03 16:11:57 +09:00
namespace osu.Game.Rulesets.Taiko.Objects.Drawables
{
2018-08-03 16:56:46 +09:00
/// <summary>
2020-12-14 21:47:31 +01:00
/// Used as a nested hitobject to provide <see cref="TaikoStrongJudgement"/>s for <see cref="DrawableTaikoStrongableHitObject{TObject,TStrongNestedObject}"/>s.
2018-08-03 16:56:46 +09:00
/// </summary>
2022-11-24 14:32:20 +09:00
public abstract partial class DrawableStrongNestedHit : DrawableTaikoHitObject
2018-08-03 16:11:57 +09:00
{
2023-06-24 00:59:36 +09:00
public new DrawableTaikoHitObject ? ParentHitObject = > base . ParentHitObject as DrawableTaikoHitObject ;
2018-08-03 16:46:03 +09:00
2023-06-24 00:59:36 +09:00
protected DrawableStrongNestedHit ( StrongNestedHitObject ? nestedHit )
2020-12-13 12:18:29 +01:00
: base ( nestedHit )
2018-08-03 16:11:57 +09:00
{
}
2023-07-15 20:24:40 +07:00
public override void OnKilled ( )
{
base . OnKilled ( ) ;
2023-07-15 18:22:04 +02:00
// usually, the strong nested hit isn't judged itself, it is judged by its parent object.
// however, in rare cases (see: drum rolls, hits with hidden active),
// it can happen that the hit window of the nested strong hit extends past the lifetime of the parent object.
// this is a safety to prevent such cases from causing the nested hit to never be judged and as such prevent gameplay from completing.
2023-07-15 22:33:16 +07:00
if ( ! Judged & & Time . Current > ParentHitObject ? . HitObject . GetEndTime ( ) )
2024-02-05 13:21:01 +01:00
ApplyMinResult ( ) ;
2023-07-15 20:24:40 +07:00
}
2018-08-03 16:11:57 +09:00
}
}