Remove nullability of `bonusNote`

This commit is contained in:
Dean Herbert 2023-10-16 13:14:58 +09:00
parent 850950ba61
commit ddbda69751
No known key found for this signature in database
1 changed files with 3 additions and 7 deletions

View File

@ -4,7 +4,6 @@
#nullable disable
using System.Diagnostics;
using JetBrains.Annotations;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Graphics;
@ -41,7 +40,6 @@ public partial class DrawableNote : DrawableManiaHitObject<Note>, IKeyBindingHan
private Drawable headPiece;
[CanBeNull]
private DrawablePerfectBonusNote bonusNote;
public DrawableNote()
@ -96,7 +94,7 @@ protected override void CheckForResult(bool userTriggered, double timeOffset)
{
if (!HitObject.HitWindows.CanBeHit(timeOffset))
{
bonusNote!.TriggerResult(false);
bonusNote.TriggerResult(false);
ApplyResult(r => r.Type = r.Judgement.MinResult);
}
@ -107,7 +105,7 @@ protected override void CheckForResult(bool userTriggered, double timeOffset)
if (result == HitResult.None)
return;
bonusNote!.TriggerResult(result == HitResult.Perfect);
bonusNote.TriggerResult(result == HitResult.Perfect);
ApplyResult(r => r.Type = MutateResultApplication(result));
}
@ -140,9 +138,7 @@ protected override void AddNestedHitObject(DrawableHitObject hitObject)
protected override void ClearNestedHitObjects()
{
if (bonusNote != null)
RemoveInternal(bonusNote, false);
bonusNote = null;
RemoveInternal(bonusNote, false);
}
protected override DrawableHitObject CreateNestedHitObject(HitObject hitObject)