mirror of
https://github.com/ppy/osu.git
synced 2025-02-13 16:02:58 +08:00
Makes HasFailed private set and removes alreadyFailed
This commit is contained in:
parent
86419e0ded
commit
493fe1d621
@ -66,20 +66,15 @@ namespace osu.Game.Rulesets.Scoring
|
||||
/// </summary>
|
||||
protected virtual bool HasCompleted => false;
|
||||
|
||||
/// <summary>
|
||||
/// Whether the score is in a failed state.
|
||||
/// </summary>
|
||||
public virtual bool HasFailed => alreadyFailed;
|
||||
|
||||
/// <summary>
|
||||
/// The conditions for failing
|
||||
/// </summary>
|
||||
protected virtual bool FailCondition => Health.Value == Health.MinValue;
|
||||
|
||||
/// <summary>
|
||||
/// Whether this ScoreProcessor has already triggered the failed state.
|
||||
/// </summary>
|
||||
private bool alreadyFailed;
|
||||
public virtual bool HasFailed { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// The conditions for failing.
|
||||
/// </summary>
|
||||
protected virtual bool FailCondition => Health.Value == Health.MinValue;
|
||||
|
||||
protected ScoreProcessor()
|
||||
{
|
||||
@ -115,7 +110,7 @@ namespace osu.Game.Rulesets.Scoring
|
||||
Rank.Value = ScoreRank.X;
|
||||
HighestCombo.Value = 0;
|
||||
|
||||
alreadyFailed = false;
|
||||
HasFailed = false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -126,11 +121,11 @@ namespace osu.Game.Rulesets.Scoring
|
||||
/// </summary>
|
||||
protected void UpdateFailed()
|
||||
{
|
||||
if (alreadyFailed || !FailCondition)
|
||||
if (HasFailed || !FailCondition)
|
||||
return;
|
||||
|
||||
if (Failed?.Invoke() != false)
|
||||
alreadyFailed = true;
|
||||
HasFailed = true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
Loading…
Reference in New Issue
Block a user