Add HitWindows to JudgementResult to indicate timing errors

This commit is contained in:
smoogipoo
2019-09-02 16:28:14 +09:00
parent f3656475de
commit f2bdf94a1d
10 changed files with 34 additions and 14 deletions

View File

@ -99,7 +99,7 @@ namespace osu.Game.Rulesets.Objects.Drawables
if (judgement != null)
{
Result = CreateResult(judgement);
Result = CreateResult(judgement, HitObject.HitWindows);
if (Result == null)
throw new InvalidOperationException($"{GetType().ReadableName()} must provide a {nameof(JudgementResult)} through {nameof(CreateResult)}.");
}
@ -401,7 +401,9 @@ namespace osu.Game.Rulesets.Objects.Drawables
/// Creates the <see cref="JudgementResult"/> that represents the scoring result for this <see cref="DrawableHitObject"/>.
/// </summary>
/// <param name="judgement">The <see cref="Judgement"/> that provides the scoring information.</param>
protected virtual JudgementResult CreateResult(Judgement judgement) => new JudgementResult(judgement);
/// <param name="hitWindows">The <see cref="HitWindows"/> which the <see cref="HitObject"/> was judged against.
/// May be null to indicate that the timing error should not be displayed to the user.</param>
protected virtual JudgementResult CreateResult(Judgement judgement, HitWindows hitWindows) => new JudgementResult(judgement, hitWindows);
}
public abstract class DrawableHitObject<TObject> : DrawableHitObject