mirror of
https://github.com/osukey/osukey.git
synced 2025-06-23 20:27:58 +09: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>
|
/// </summary>
|
||||||
protected virtual bool HasCompleted => false;
|
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>
|
/// <summary>
|
||||||
/// Whether this ScoreProcessor has already triggered the failed state.
|
/// Whether this ScoreProcessor has already triggered the failed state.
|
||||||
/// </summary>
|
/// </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()
|
protected ScoreProcessor()
|
||||||
{
|
{
|
||||||
@ -115,7 +110,7 @@ namespace osu.Game.Rulesets.Scoring
|
|||||||
Rank.Value = ScoreRank.X;
|
Rank.Value = ScoreRank.X;
|
||||||
HighestCombo.Value = 0;
|
HighestCombo.Value = 0;
|
||||||
|
|
||||||
alreadyFailed = false;
|
HasFailed = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -126,11 +121,11 @@ namespace osu.Game.Rulesets.Scoring
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
protected void UpdateFailed()
|
protected void UpdateFailed()
|
||||||
{
|
{
|
||||||
if (alreadyFailed || !FailCondition)
|
if (HasFailed || !FailCondition)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (Failed?.Invoke() != false)
|
if (Failed?.Invoke() != false)
|
||||||
alreadyFailed = true;
|
HasFailed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user