mirror of
https://github.com/osukey/osukey.git
synced 2025-08-05 15:44:04 +09:00
Merge remote-tracking branch 'origin/master' into performance-calculator
This commit is contained in:
@ -31,6 +31,11 @@ namespace osu.Game.Rulesets.Scoring
|
||||
/// </summary>
|
||||
public event Action<Judgement> NewJudgement;
|
||||
|
||||
/// <summary>
|
||||
/// Additional conditions on top of <see cref="DefaultFailCondition"/> that cause a failing state.
|
||||
/// </summary>
|
||||
public event Func<ScoreProcessor, bool> FailConditions;
|
||||
|
||||
/// <summary>
|
||||
/// The current total score.
|
||||
/// </summary>
|
||||
@ -72,9 +77,9 @@ namespace osu.Game.Rulesets.Scoring
|
||||
public virtual bool HasFailed { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// The conditions for failing.
|
||||
/// The default conditions for failing.
|
||||
/// </summary>
|
||||
protected virtual bool FailCondition => Health.Value == Health.MinValue;
|
||||
protected virtual bool DefaultFailCondition => Health.Value == Health.MinValue;
|
||||
|
||||
protected ScoreProcessor()
|
||||
{
|
||||
@ -121,7 +126,10 @@ namespace osu.Game.Rulesets.Scoring
|
||||
/// </summary>
|
||||
protected void UpdateFailed()
|
||||
{
|
||||
if (HasFailed || !FailCondition)
|
||||
if (HasFailed)
|
||||
return;
|
||||
|
||||
if (!DefaultFailCondition && FailConditions?.Invoke(this) != true)
|
||||
return;
|
||||
|
||||
if (Failed?.Invoke() != false)
|
||||
|
Reference in New Issue
Block a user