2019-01-24 08:43:03 +00: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 09:19:50 +00:00
|
|
|
|
|
2022-11-19 20:27:48 +00:00
|
|
|
|
using System;
|
2017-09-18 13:32:49 +00:00
|
|
|
|
using System.Linq;
|
2018-03-02 06:34:31 +00:00
|
|
|
|
using NUnit.Framework;
|
2017-09-18 13:32:49 +00:00
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
|
using osu.Game.Graphics.UserInterface;
|
2018-11-20 07:51:59 +00:00
|
|
|
|
using osuTK;
|
2018-04-13 09:19:50 +00:00
|
|
|
|
|
2019-03-24 16:02:36 +00:00
|
|
|
|
namespace osu.Game.Tests.Visual.Online
|
2017-09-18 13:32:49 +00:00
|
|
|
|
{
|
2018-03-02 06:34:31 +00:00
|
|
|
|
[TestFixture]
|
2019-05-14 19:37:25 +00:00
|
|
|
|
public partial class TestSceneGraph : OsuTestScene
|
2017-09-18 13:32:49 +00:00
|
|
|
|
{
|
2019-05-14 19:37:25 +00:00
|
|
|
|
public TestSceneGraph()
|
2017-09-18 13:32:49 +00:00
|
|
|
|
{
|
2023-11-08 08:23:01 +00:00
|
|
|
|
BarGraph graph;
|
|
|
|
|
|
2023-11-06 17:45:52 +00:00
|
|
|
|
Child = graph = new BarGraph
|
2017-09-18 13:32:49 +00:00
|
|
|
|
{
|
2023-11-06 17:45:52 +00:00
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
|
Origin = Anchor.Centre,
|
|
|
|
|
Size = new Vector2(0.5f),
|
2017-09-18 13:32:49 +00:00
|
|
|
|
};
|
2018-04-13 09:19:50 +00:00
|
|
|
|
|
2017-09-18 13:32:49 +00:00
|
|
|
|
AddStep("values from 1-10", () => graph.Values = Enumerable.Range(1, 10).Select(i => (float)i));
|
2023-11-06 17:45:52 +00:00
|
|
|
|
AddStep("small values", () => graph.Values = Enumerable.Range(1, 10).Select(i => i * 0.01f).Concat(new[] { 100f }));
|
2017-09-18 13:32:49 +00:00
|
|
|
|
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 20:27:48 +00:00
|
|
|
|
AddStep("empty values", () => graph.Values = Array.Empty<float>());
|
2017-09-18 13:32:49 +00: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);
|
2023-11-06 17:45:52 +00:00
|
|
|
|
|
2023-11-08 08:23:01 +00:00
|
|
|
|
AddToggleStep("Toggle movement", enabled =>
|
|
|
|
|
{
|
|
|
|
|
if (enabled)
|
|
|
|
|
graph.MoveToY(-10, 1000).Then().MoveToY(10, 1000).Loop();
|
|
|
|
|
else
|
|
|
|
|
graph.ClearTransforms();
|
|
|
|
|
});
|
2023-11-06 17:45:52 +00:00
|
|
|
|
}
|
2017-09-18 13:32:49 +00:00
|
|
|
|
}
|
2017-11-23 07:00:33 +00:00
|
|
|
|
}
|