1
0
mirror of https://github.com/ppy/osu.git synced 2026-06-03 18:03:55 +08:00

Use median for statistic display

This commit is contained in:
sineplusx
2025-03-29 13:44:14 +01:00
Unverified
parent 4b8fe015e5
commit fa06643bb6
@@ -8,18 +8,18 @@ using osu.Game.Rulesets.Scoring;
namespace osu.Game.Screens.Ranking.Statistics
{
/// <summary>
/// Displays the unstable rate statistic for a given play.
/// Displays the average hit error statistic for a given play.
/// </summary>
public partial class AverageHitError : SimpleStatisticItem<double?>
{
/// <summary>
/// Creates and computes an <see cref="AverageHitError"/> statistic.
/// </summary>
/// <param name="hitEvents">Sequence of <see cref="HitEvent"/>s to calculate the unstable rate based on.</param>
/// <param name="hitEvents">Sequence of <see cref="HitEvent"/>s to calculate the average hit error based on.</param>
public AverageHitError(IEnumerable<HitEvent> hitEvents)
: base("Average Hit Error")
{
Value = hitEvents.CalculateAverageHitError();
Value = hitEvents.CalculateMedianHitError();
}
protected override string DisplayValue(double? value) => value == null ? "(not available)" : $"{Math.Abs(value.Value):N2} ms {(value.Value < 0 ? "early" : "late")}";