Add "Final" to better determine when to stop processing the hitobject

This commit is contained in:
smoogipoo 2017-11-02 21:54:28 +09:00
parent 8ee13ef0ae
commit 326891f51c
2 changed files with 8 additions and 3 deletions

View File

@ -32,6 +32,11 @@ namespace osu.Game.Rulesets.Judgements
/// </summary>
public bool IsHit => Result > HitResult.Miss;
/// <summary>
/// Whether this judgement is the final judgement for the hit object.
/// </summary>
public bool Final = true;
/// <summary>
/// The offset from a perfect hit at which this judgement occurred.
/// Populated when added via <see cref="DrawableHitObject{TObject}.AddJudgement"/>.

View File

@ -105,12 +105,12 @@ namespace osu.Game.Rulesets.Objects.Drawables
}
private bool judgementOccurred;
private bool hasJudgementResult => Judgements.LastOrDefault()?.Result >= HitResult.Miss;
private bool judgementFinalized => judgements.LastOrDefault()?.Final == true;
/// <summary>
/// Whether this <see cref="DrawableHitObject"/> and all of its nested <see cref="DrawableHitObject"/>s have been judged.
/// </summary>
public virtual bool AllJudged => (!ProvidesJudgement || hasJudgementResult) && (NestedHitObjects?.All(h => h.AllJudged) ?? true);
public virtual bool AllJudged => (!ProvidesJudgement || judgementFinalized) && (NestedHitObjects?.All(h => h.AllJudged) ?? true);
/// <summary>
/// Notifies that a new judgement has occurred for this <see cref="DrawableHitObject"/>.
@ -159,7 +159,7 @@ namespace osu.Game.Rulesets.Objects.Drawables
judgementOccurred |= d.UpdateJudgement(userTriggered);
}
if (!ProvidesJudgement || hasJudgementResult || judgementOccurred)
if (!ProvidesJudgement || judgementFinalized || judgementOccurred)
return judgementOccurred;
var endTime = (HitObject as IHasEndTime)?.EndTime ?? HitObject.StartTime;