Apply nullability to BarHitErrorMeter

This commit is contained in:
Dean Herbert 2022-11-14 01:07:53 +09:00
parent 576f462f59
commit a86b50d62a

View File

@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // 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. // See the LICENCE file in the repository root for full licence text.
#nullable disable
using System; using System;
using System.Linq; using System.Linq;
using osu.Framework.Allocation; using osu.Framework.Allocation;
@ -27,8 +25,6 @@ namespace osu.Game.Screens.Play.HUD.HitErrorMeters
[Cached] [Cached]
public class BarHitErrorMeter : HitErrorMeter public class BarHitErrorMeter : HitErrorMeter
{ {
private const int judgement_line_width = 14;
[SettingSource("Judgement line thickness", "How thick the individual lines should be.")] [SettingSource("Judgement line thickness", "How thick the individual lines should be.")]
public BindableNumber<float> JudgementLineThickness { get; } = new BindableNumber<float>(4) public BindableNumber<float> JudgementLineThickness { get; } = new BindableNumber<float>(4)
{ {
@ -46,30 +42,33 @@ namespace osu.Game.Screens.Play.HUD.HitErrorMeters
[SettingSource("Label style", "How to show early/late extremities")] [SettingSource("Label style", "How to show early/late extremities")]
public Bindable<LabelStyles> LabelStyle { get; } = new Bindable<LabelStyles>(LabelStyles.Icons); public Bindable<LabelStyles> LabelStyle { get; } = new Bindable<LabelStyles>(LabelStyles.Icons);
private readonly DrawablePool<JudgementLine> judgementLinePool = new DrawablePool<JudgementLine>(50, 100); private const int judgement_line_width = 14;
private SpriteIcon arrow; private const int max_concurrent_judgements = 50;
private UprightAspectMaintainingContainer labelEarly;
private UprightAspectMaintainingContainer labelLate;
private Container colourBarsEarly; private const int centre_marker_size = 8;
private Container colourBarsLate;
private Container judgementsContainer;
private double maxHitWindow; private double maxHitWindow;
private double floatingAverage; private double floatingAverage;
private Container colourBars;
private Container arrowContainer;
private (HitResult result, double length)[] hitWindows; private readonly DrawablePool<JudgementLine> judgementLinePool = new DrawablePool<JudgementLine>(50, 100);
private const int max_concurrent_judgements = 50; private SpriteIcon arrow = null!;
private UprightAspectMaintainingContainer labelEarly = null!;
private UprightAspectMaintainingContainer labelLate = null!;
private Drawable[] centreMarkerDrawables; private Container colourBarsEarly = null!;
private Container colourBarsLate = null!;
private const int centre_marker_size = 8; private Container judgementsContainer = null!;
private Container colourBars = null!;
private Container arrowContainer = null!;
private (HitResult result, double length)[] hitWindows = null!;
private Drawable[]? centreMarkerDrawables;
public BarHitErrorMeter() public BarHitErrorMeter()
{ {
@ -427,6 +426,9 @@ namespace osu.Game.Screens.Play.HUD.HitErrorMeters
{ {
public readonly BindableNumber<float> JudgementLineThickness = new BindableFloat(); public readonly BindableNumber<float> JudgementLineThickness = new BindableFloat();
[Resolved]
private BarHitErrorMeter barHitErrorMeter { get; set; } = null!;
public JudgementLine() public JudgementLine()
{ {
RelativeSizeAxes = Axes.X; RelativeSizeAxes = Axes.X;
@ -443,9 +445,6 @@ namespace osu.Game.Screens.Play.HUD.HitErrorMeters
}; };
} }
[Resolved]
private BarHitErrorMeter barHitErrorMeter { get; set; }
protected override void LoadComplete() protected override void LoadComplete()
{ {
base.LoadComplete(); base.LoadComplete();