mirror of
https://github.com/osukey/osukey.git
synced 2025-08-06 08:03:52 +09:00
Nullable annotate classes
This commit is contained in:
@ -1,6 +1,8 @@
|
|||||||
// 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 enable
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
using osu.Framework.Utils;
|
using osu.Framework.Utils;
|
||||||
@ -14,12 +16,12 @@ namespace osu.Game.Rulesets.Scoring
|
|||||||
/// Invoked when the <see cref="ScoreProcessor"/> is in a failed state.
|
/// Invoked when the <see cref="ScoreProcessor"/> is in a failed state.
|
||||||
/// Return true if the fail was permitted.
|
/// Return true if the fail was permitted.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public event Func<bool> Failed;
|
public event Func<bool>? Failed;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Additional conditions on top of <see cref="DefaultFailCondition"/> that cause a failing state.
|
/// Additional conditions on top of <see cref="DefaultFailCondition"/> that cause a failing state.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public event Func<HealthProcessor, JudgementResult, bool> FailConditions;
|
public event Func<HealthProcessor, JudgementResult, bool>? FailConditions;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The current health.
|
/// The current health.
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
// 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 enable
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
using osu.Framework.Extensions.TypeExtensions;
|
using osu.Framework.Extensions.TypeExtensions;
|
||||||
@ -17,12 +19,12 @@ namespace osu.Game.Rulesets.Scoring
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Invoked when a new judgement has occurred. This occurs after the judgement has been processed by this <see cref="JudgementProcessor"/>.
|
/// Invoked when a new judgement has occurred. This occurs after the judgement has been processed by this <see cref="JudgementProcessor"/>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public event Action<JudgementResult> NewJudgement;
|
public event Action<JudgementResult>? NewJudgement;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Invoked when a judgement is reverted, usually due to rewinding gameplay.
|
/// Invoked when a judgement is reverted, usually due to rewinding gameplay.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public event Action<JudgementResult> JudgementReverted;
|
public event Action<JudgementResult>? JudgementReverted;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The maximum number of hits that can be judged.
|
/// The maximum number of hits that can be judged.
|
||||||
@ -34,7 +36,7 @@ namespace osu.Game.Rulesets.Scoring
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public int JudgedHits { get; private set; }
|
public int JudgedHits { get; private set; }
|
||||||
|
|
||||||
private JudgementResult lastAppliedResult;
|
private JudgementResult? lastAppliedResult;
|
||||||
|
|
||||||
private readonly BindableBool hasCompleted = new BindableBool();
|
private readonly BindableBool hasCompleted = new BindableBool();
|
||||||
|
|
||||||
@ -163,7 +165,7 @@ namespace osu.Game.Rulesets.Scoring
|
|||||||
protected override void Update()
|
protected override void Update()
|
||||||
{
|
{
|
||||||
base.Update();
|
base.Update();
|
||||||
hasCompleted.Value = JudgedHits == MaxHits && (JudgedHits == 0 || lastAppliedResult.TimeAbsolute < Clock.CurrentTime);
|
hasCompleted.Value = JudgedHits == MaxHits && (JudgedHits == 0 || lastAppliedResult?.TimeAbsolute < Clock.CurrentTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
// 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 enable
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
@ -24,7 +26,7 @@ namespace osu.Game.Rulesets.Scoring
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Invoked when this <see cref="ScoreProcessor"/> was reset from a replay frame.
|
/// Invoked when this <see cref="ScoreProcessor"/> was reset from a replay frame.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public event Action OnResetFromReplayFrame;
|
public event Action? OnResetFromReplayFrame;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The current total score.
|
/// The current total score.
|
||||||
@ -110,7 +112,7 @@ namespace osu.Game.Rulesets.Scoring
|
|||||||
|
|
||||||
private readonly Dictionary<HitResult, int> scoreResultCounts = new Dictionary<HitResult, int>();
|
private readonly Dictionary<HitResult, int> scoreResultCounts = new Dictionary<HitResult, int>();
|
||||||
private readonly List<HitEvent> hitEvents = new List<HitEvent>();
|
private readonly List<HitEvent> hitEvents = new List<HitEvent>();
|
||||||
private HitObject lastHitObject;
|
private HitObject? lastHitObject;
|
||||||
|
|
||||||
private double scoreMultiplier = 1;
|
private double scoreMultiplier = 1;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user