// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Rulesets.Scoring; namespace osu.Game.Rulesets.Judgements { public class Judgement { /// /// Whether this judgement is the result of a hit or a miss. /// public HitResult Result; /// /// The maximum that can be achieved. /// public virtual HitResult MaxResult => HitResult.Perfect; /// /// The combo prior to this judgement occurring. /// public int ComboAtJudgement; /// /// The highest combo achieved prior to this judgement occurring. /// public int HighestComboAtJudgement; /// /// Whether a successful hit occurred. /// public bool IsHit => Result > HitResult.Miss; /// /// Whether this judgement is the final judgement for the hit object. /// public bool Final = true; /// /// The offset from a perfect hit at which this judgement occurred. /// Populated when added via . /// public double TimeOffset { get; set; } /// /// Whether the should affect the current combo. /// public virtual bool AffectsCombo => true; /// /// Whether the should be counted as base (combo) or bonus score. /// public virtual bool IsBonus => !AffectsCombo; /// /// The numeric representation for the result achieved. /// public int NumericResult => NumericResultFor(Result); /// /// The numeric representation for the maximum achievable result. /// public int MaxNumericResult => NumericResultFor(MaxResult); /// /// Convert a to a numeric score representation. /// /// The value to convert. /// The number. protected virtual int NumericResultFor(HitResult result) => result > HitResult.Miss ? 1 : 0; } }