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