2020-04-30 16:38:37 +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.
|
|
|
|
|
2022-06-17 15:37:17 +08:00
|
|
|
#nullable disable
|
|
|
|
|
2020-05-01 18:49:30 +08:00
|
|
|
using osu.Framework.Extensions.IEnumerableExtensions;
|
|
|
|
using osu.Framework.Testing;
|
2020-05-12 14:23:47 +08:00
|
|
|
using osu.Framework.Timing;
|
2020-05-03 22:55:44 +08:00
|
|
|
using osu.Game.Rulesets.Judgements;
|
2021-05-15 05:39:36 +08:00
|
|
|
using osu.Game.Rulesets.Objects;
|
2020-05-03 22:55:44 +08:00
|
|
|
using osu.Game.Rulesets.Scoring;
|
2020-12-07 11:30:25 +08:00
|
|
|
using osu.Game.Rulesets.Taiko.Skinning.Legacy;
|
2020-04-30 16:38:37 +08:00
|
|
|
using osu.Game.Skinning;
|
|
|
|
|
|
|
|
namespace osu.Game.Rulesets.Taiko.Tests.Skinning
|
|
|
|
{
|
|
|
|
public partial class TestSceneTaikoScroller : TaikoSkinnableTestScene
|
|
|
|
{
|
2020-05-12 14:23:47 +08:00
|
|
|
private readonly ManualClock clock = new ManualClock();
|
|
|
|
|
|
|
|
private bool reversed;
|
|
|
|
|
2020-04-30 16:38:37 +08:00
|
|
|
public TestSceneTaikoScroller()
|
|
|
|
{
|
2021-06-02 15:04:53 +08:00
|
|
|
AddStep("Load scroller", () => SetContents(_ =>
|
2022-11-09 15:04:56 +08:00
|
|
|
new SkinnableDrawable(new TaikoSkinComponentLookup(TaikoSkinComponents.Scroller), _ => Empty())
|
2020-05-12 14:23:47 +08:00
|
|
|
{
|
2020-05-12 15:58:47 +08:00
|
|
|
Clock = new FramedClock(clock),
|
|
|
|
Height = 0.4f,
|
2020-05-12 14:23:47 +08:00
|
|
|
}));
|
2020-05-14 16:04:09 +08:00
|
|
|
|
2020-05-03 22:55:44 +08:00
|
|
|
AddToggleStep("Toggle passing", passing => this.ChildrenOfType<LegacyTaikoScroller>().ForEach(s => s.LastResult.Value =
|
2021-05-15 05:39:36 +08:00
|
|
|
new JudgementResult(new HitObject(), new Judgement()) { Type = passing ? HitResult.Great : HitResult.Miss }));
|
2020-05-12 14:23:47 +08:00
|
|
|
|
|
|
|
AddToggleStep("toggle playback direction", reversed => this.reversed = reversed);
|
|
|
|
}
|
|
|
|
|
|
|
|
protected override void Update()
|
|
|
|
{
|
|
|
|
base.Update();
|
|
|
|
|
|
|
|
clock.CurrentTime += (reversed ? -1 : 1) * Clock.ElapsedFrameTime;
|
2020-04-30 16:38:37 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|