2019-01-24 17:43:03 +09: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.
|
2018-04-13 18:19:50 +09:00
|
|
|
|
|
2022-06-17 16:37:17 +09:00
|
|
|
|
#nullable disable
|
|
|
|
|
|
2022-11-19 23:27:48 +03:00
|
|
|
|
using System;
|
2018-04-13 18:19:50 +09:00
|
|
|
|
using System.Linq;
|
|
|
|
|
using NUnit.Framework;
|
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
|
using osu.Game.Graphics.UserInterface;
|
2018-11-20 16:51:59 +09:00
|
|
|
|
using osuTK;
|
2018-04-13 18:19:50 +09:00
|
|
|
|
|
2019-03-25 01:02:36 +09:00
|
|
|
|
namespace osu.Game.Tests.Visual.Online
|
2018-04-13 18:19:50 +09:00
|
|
|
|
{
|
|
|
|
|
[TestFixture]
|
2022-11-24 14:32:20 +09:00
|
|
|
|
public partial class TestSceneGraph : OsuTestScene
|
2018-04-13 18:19:50 +09:00
|
|
|
|
{
|
2019-05-14 22:37:25 +03:00
|
|
|
|
public TestSceneGraph()
|
2018-04-13 18:19:50 +09:00
|
|
|
|
{
|
|
|
|
|
BarGraph graph;
|
|
|
|
|
|
|
|
|
|
Children = new[]
|
|
|
|
|
{
|
|
|
|
|
graph = new BarGraph
|
|
|
|
|
{
|
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
|
Origin = Anchor.Centre,
|
|
|
|
|
Size = new Vector2(0.5f),
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
AddStep("values from 1-10", () => graph.Values = Enumerable.Range(1, 10).Select(i => (float)i));
|
|
|
|
|
AddStep("values from 1-100", () => graph.Values = Enumerable.Range(1, 100).Select(i => (float)i));
|
|
|
|
|
AddStep("reversed values from 1-10", () => graph.Values = Enumerable.Range(1, 10).Reverse().Select(i => (float)i));
|
2022-11-19 23:27:48 +03:00
|
|
|
|
AddStep("empty values", () => graph.Values = Array.Empty<float>());
|
2018-04-13 18:19:50 +09:00
|
|
|
|
AddStep("Bottom to top", () => graph.Direction = BarDirection.BottomToTop);
|
|
|
|
|
AddStep("Top to bottom", () => graph.Direction = BarDirection.TopToBottom);
|
|
|
|
|
AddStep("Left to right", () => graph.Direction = BarDirection.LeftToRight);
|
|
|
|
|
AddStep("Right to left", () => graph.Direction = BarDirection.RightToLeft);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|