Merge pull request #1902 from Aergwyn/expose-ishit

Expose "IsHit" on DrawableHitObject
This commit is contained in:
Dan Balasescu 2018-01-14 00:35:21 +09:00 committed by GitHub
commit 25d4445543
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -49,6 +49,11 @@ public abstract class DrawableHitObject : Container, IHasAccentColour
/// </summary>
public virtual bool DisplayJudgement => true;
/// <summary>
/// Whether this <see cref="DrawableHitObject"/> and all of its nested <see cref="DrawableHitObject"/>s have been hit.
/// </summary>
public bool IsHit => Judgements.Any(j => j.Final && j.IsHit) && (NestedHitObjects?.All(n => n.IsHit) ?? true);
/// <summary>
/// Whether this <see cref="DrawableHitObject"/> and all of its nested <see cref="DrawableHitObject"/>s have been judged.
/// </summary>