Improve test scene

This commit is contained in:
smoogipoo 2020-06-16 17:49:37 +09:00
parent a2ddb4edb4
commit 808e216059
2 changed files with 14 additions and 3 deletions

View File

@ -1,8 +1,10 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System.Collections.Generic;
using NUnit.Framework;
using osu.Game.Rulesets.Osu;
using osu.Game.Rulesets.Osu.Scoring;
using osu.Game.Scoring;
using osu.Game.Screens.Ranking.Statistics;
@ -13,7 +15,16 @@ public class TestSceneStatisticsPanel : OsuTestScene
[Test]
public void TestScore()
{
loadPanel(new TestScoreInfo(new OsuRuleset().RulesetInfo));
var score = new TestScoreInfo(new OsuRuleset().RulesetInfo)
{
ExtraStatistics =
{
["timing_distribution"] = TestSceneTimingDistributionGraph.CreateNormalDistribution(),
["hit_offsets"] = new List<HitOffset>()
}
};
loadPanel(score);
}
private void loadPanel(ScoreInfo score) => AddStep("load panel", () =>

View File

@ -22,7 +22,7 @@ public TestSceneTimingDistributionGraph()
RelativeSizeAxes = Axes.Both,
Colour = Color4Extensions.FromHex("#333")
},
new TimingDistributionGraph(createNormalDistribution())
new TimingDistributionGraph(CreateNormalDistribution())
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
@ -31,7 +31,7 @@ public TestSceneTimingDistributionGraph()
};
}
private TimingDistribution createNormalDistribution()
public static TimingDistribution CreateNormalDistribution()
{
var distribution = new TimingDistribution(51, 5);