1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-28 23:42:56 +08:00
osu-lazer/osu.Game.Rulesets.Taiko.Tests/Skinning/TestSceneTaikoPlayfield.cs

47 lines
1.6 KiB
C#
Raw Normal View History

2020-04-21 17:40:18 +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.
2020-04-21 18:00:34 +08:00
using System;
using System.Collections.Generic;
using System.Linq;
2020-04-21 17:40:18 +08:00
using osu.Framework.Allocation;
using osu.Framework.Extensions.IEnumerableExtensions;
2020-04-21 17:40:18 +08:00
using osu.Framework.Graphics;
using osu.Framework.Testing;
2020-04-21 17:40:18 +08:00
using osu.Game.Beatmaps.ControlPoints;
2020-04-21 18:00:34 +08:00
using osu.Game.Rulesets.Taiko.Skinning;
2020-04-21 17:40:18 +08:00
using osu.Game.Rulesets.Taiko.UI;
using osu.Game.Rulesets.UI.Scrolling;
using osu.Game.Tests.Visual;
namespace osu.Game.Rulesets.Taiko.Tests.Skinning
{
public class TestSceneTaikoPlayfield : TaikoSkinnableTestScene
{
2020-04-21 18:00:34 +08:00
public override IReadOnlyList<Type> RequiredTypes => base.RequiredTypes.Concat(new[]
{
typeof(TaikoHitTarget),
typeof(TaikoLegacyHitTarget),
typeof(PlayfieldBackgroundRight),
2020-04-21 18:00:34 +08:00
}).ToList();
2020-04-21 17:40:18 +08:00
[Cached(typeof(IScrollingInfo))]
private ScrollingTestContainer.TestScrollingInfo info = new ScrollingTestContainer.TestScrollingInfo
{
Direction = { Value = ScrollingDirection.Left },
TimeRange = { Value = 5000 },
};
public TestSceneTaikoPlayfield()
{
AddStep("Load playfield", () => SetContents(() => new TaikoPlayfield(new ControlPointInfo())
{
Anchor = Anchor.CentreLeft,
Origin = Anchor.CentreLeft,
}));
AddRepeatStep("change height", () => this.ChildrenOfType<TaikoPlayfield>().ForEach(p => p.Height = Math.Max(0.2f, (p.Height + 0.2f) % 1f)), 50);
2020-04-21 17:40:18 +08:00
}
}
}