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.
|
|
|
|
|
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;
|
|
|
|
using osu.Game.Rulesets.Scoring;
|
2020-05-01 10:49:30 +00:00
|
|
|
using osu.Game.Rulesets.Taiko.Skinning;
|
2020-04-30 08:38:37 +00:00
|
|
|
using osu.Game.Skinning;
|
|
|
|
|
|
|
|
namespace osu.Game.Rulesets.Taiko.Tests.Skinning
|
|
|
|
{
|
|
|
|
public 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()
|
|
|
|
{
|
2020-05-12 06:23:47 +00:00
|
|
|
AddStep("Load scroller", () => SetContents(() =>
|
2020-05-14 08:04:09 +00:00
|
|
|
new SkinnableDrawable(new TaikoSkinComponent(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 =
|
|
|
|
new JudgementResult(null, new Judgement()) { Type = passing ? HitResult.Perfect : 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
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|