// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using JetBrains.Annotations; using osu.Game.Rulesets.Objects; using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Rulesets.Scoring; namespace osu.Game.Rulesets.Judgements { /// /// The scoring result of a . /// public class JudgementResult { /// /// Whether this is the result of a hit or a miss. /// public HitResult Type; /// /// The which was judged. /// [NotNull] public readonly HitObject HitObject; /// /// The which this applies for. /// [NotNull] public readonly Judgement Judgement; /// /// The offset from a perfect hit at which this occurred. /// Populated when this is applied via . /// public double TimeOffset { get; internal set; } /// /// The combo prior to this occurring. /// public int ComboAtJudgement { get; internal set; } /// /// The highest combo achieved prior to this occurring. /// public int HighestComboAtJudgement { get; internal set; } /// /// The health prior to this occurring. /// public double HealthAtJudgement { get; internal set; } /// /// Whether the user was in a failed state prior to this occurring. /// public bool FailedAtJudgement { get; internal set; } /// /// Whether a miss or hit occurred. /// public bool HasResult => Type > HitResult.None; /// /// Whether a successful hit occurred. /// public bool IsHit => Type.IsHit(); /// /// Creates a new . /// /// The which was judged. /// The to refer to for scoring information. public JudgementResult([NotNull] HitObject hitObject, [NotNull] Judgement judgement) { HitObject = hitObject; Judgement = judgement; } public override string ToString() => $"{Type} (Score:{Judgement.NumericResultFor(this)} HP:{Judgement.HealthIncreaseFor(this)} {Judgement})"; } }