Show hit error on results screen

Leading up to implementation of "local offset", this feels like a good
thing to have visible first and foremost.
This commit is contained in:
Dean Herbert
2022-02-28 19:11:06 +09:00
parent 97de36d849
commit a41e1c80f1
5 changed files with 33 additions and 0 deletions

View File

@ -22,6 +22,9 @@ namespace osu.Game.Rulesets.Scoring
return 10 * standardDeviation(timeOffsets);
}
public static double? CalculateAverageHitError(this IEnumerable<HitEvent> hitEvents) =>
hitEvents.Where(affectsUnstableRate).Select(ev => ev.TimeOffset).Average();
private static bool affectsUnstableRate(HitEvent e) => !(e.HitObject.HitWindows is HitWindows.EmptyHitWindows) && e.Result.IsHit();
private static double? standardDeviation(double[] timeOffsets)