1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-16 07:20:24 +08:00
osu-lazer/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableStrongNestedHit.cs

34 lines
1.5 KiB
C#
Raw Normal View History

2023-06-23 00:37:25 +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.Objects;
2018-08-03 15:56:46 +08:00
using osu.Game.Rulesets.Taiko.Judgements;
namespace osu.Game.Rulesets.Taiko.Objects.Drawables
{
2018-08-03 15:56:46 +08:00
/// <summary>
/// Used as a nested hitobject to provide <see cref="TaikoStrongJudgement"/>s for <see cref="DrawableTaikoStrongableHitObject{TObject,TStrongNestedObject}"/>s.
2018-08-03 15:56:46 +08:00
/// </summary>
2022-11-24 13:32:20 +08:00
public abstract partial class DrawableStrongNestedHit : DrawableTaikoHitObject
{
public new DrawableTaikoHitObject? ParentHitObject => base.ParentHitObject as DrawableTaikoHitObject;
2018-08-03 15:46:03 +08:00
protected DrawableStrongNestedHit(StrongNestedHitObject? nestedHit)
2020-12-13 19:18:29 +08:00
: base(nestedHit)
{
}
public override void OnKilled()
{
base.OnKilled();
// 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.
if (!Judged && Time.Current > ParentHitObject?.HitObject.GetEndTime())
ApplyResult(r => r.Type = r.Judgement.MinResult);
}
}
}