Adjust NRT to prevent future issues

This way, it will yet at us if the setter is ever moved out of the ctor.
This commit is contained in:
Dan Balasescu 2024-03-11 15:52:38 +09:00
parent fc05268fc3
commit e0f1f70b82
No known key found for this signature in database

View File

@ -3,6 +3,7 @@
using System;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
@ -79,11 +80,12 @@ namespace osu.Game.Rulesets.Osu.UI
NewResult += onNewResult;
}
private IHitPolicy hitPolicy = null!;
private IHitPolicy hitPolicy;
public IHitPolicy HitPolicy
{
get => hitPolicy;
[MemberNotNull(nameof(hitPolicy))]
set
{
hitPolicy = value ?? throw new ArgumentNullException(nameof(value));