2020-03-17 17:01:46 +08:00
|
|
|
// 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.
|
|
|
|
|
2021-05-08 17:55:07 +08:00
|
|
|
using NUnit.Framework;
|
2020-03-17 17:01:46 +08:00
|
|
|
using osu.Framework.Graphics;
|
|
|
|
using osu.Framework.Graphics.Containers;
|
2021-05-08 17:55:07 +08:00
|
|
|
using osu.Framework.Utils;
|
2020-03-17 17:01:46 +08:00
|
|
|
using osu.Game.Beatmaps;
|
|
|
|
using osu.Game.Screens.Ranking.Expanded;
|
|
|
|
|
|
|
|
namespace osu.Game.Tests.Visual.Ranking
|
|
|
|
{
|
|
|
|
public class TestSceneStarRatingDisplay : OsuTestScene
|
|
|
|
{
|
2021-05-08 23:21:29 +08:00
|
|
|
[Test]
|
|
|
|
public void TestDisplay()
|
2020-03-17 17:01:46 +08:00
|
|
|
{
|
2021-05-08 23:21:29 +08:00
|
|
|
StarRatingDisplay changingStarRating = null;
|
2021-05-08 17:55:07 +08:00
|
|
|
|
2021-05-08 23:21:29 +08:00
|
|
|
AddStep("load displays", () => Child = new FillFlowContainer
|
2020-03-17 17:01:46 +08:00
|
|
|
{
|
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
Origin = Anchor.Centre,
|
|
|
|
Children = new Drawable[]
|
|
|
|
{
|
2020-10-23 14:06:00 +08:00
|
|
|
new StarRatingDisplay(new StarDifficulty(1.23, 0)),
|
|
|
|
new StarRatingDisplay(new StarDifficulty(2.34, 0)),
|
|
|
|
new StarRatingDisplay(new StarDifficulty(3.45, 0)),
|
|
|
|
new StarRatingDisplay(new StarDifficulty(4.56, 0)),
|
|
|
|
new StarRatingDisplay(new StarDifficulty(5.67, 0)),
|
|
|
|
new StarRatingDisplay(new StarDifficulty(6.78, 0)),
|
|
|
|
new StarRatingDisplay(new StarDifficulty(10.11, 0)),
|
2021-05-08 17:55:07 +08:00
|
|
|
changingStarRating = new StarRatingDisplay(),
|
2020-03-17 17:01:46 +08:00
|
|
|
}
|
2021-05-08 23:21:29 +08:00
|
|
|
});
|
2021-05-08 17:55:07 +08:00
|
|
|
|
2021-05-08 23:21:29 +08:00
|
|
|
AddRepeatStep("change bottom rating", () =>
|
2021-05-08 17:55:07 +08:00
|
|
|
{
|
|
|
|
changingStarRating.Current.Value = new StarDifficulty(RNG.NextDouble(0, 10), RNG.Next());
|
2021-05-08 23:21:29 +08:00
|
|
|
}, 10);
|
|
|
|
}
|
2020-03-17 17:01:46 +08:00
|
|
|
}
|
|
|
|
}
|