2023-06-23 00:37:25 +08:00
|
|
|
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
2020-04-15 15:29:39 +08:00
|
|
|
|
// See the LICENCE file in the repository root for full licence text.
|
|
|
|
|
|
|
|
|
|
using NUnit.Framework;
|
|
|
|
|
using osu.Framework.Allocation;
|
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
|
using osu.Game.Beatmaps;
|
|
|
|
|
using osu.Game.Beatmaps.ControlPoints;
|
|
|
|
|
using osu.Game.Rulesets.Taiko.Objects;
|
|
|
|
|
using osu.Game.Rulesets.Taiko.Objects.Drawables;
|
|
|
|
|
using osu.Game.Rulesets.UI.Scrolling;
|
|
|
|
|
using osu.Game.Tests.Visual;
|
|
|
|
|
|
|
|
|
|
namespace osu.Game.Rulesets.Taiko.Tests.Skinning
|
|
|
|
|
{
|
|
|
|
|
[TestFixture]
|
2022-11-24 13:32:20 +08:00
|
|
|
|
public partial class TestSceneDrawableDrumRoll : TaikoSkinnableTestScene
|
2020-04-15 15:29:39 +08:00
|
|
|
|
{
|
|
|
|
|
[Cached(typeof(IScrollingInfo))]
|
|
|
|
|
private ScrollingTestContainer.TestScrollingInfo info = new ScrollingTestContainer.TestScrollingInfo
|
|
|
|
|
{
|
|
|
|
|
Direction = { Value = ScrollingDirection.Left },
|
|
|
|
|
TimeRange = { Value = 5000 },
|
|
|
|
|
};
|
|
|
|
|
|
2022-10-19 05:47:26 +08:00
|
|
|
|
[Test]
|
2022-11-23 03:28:41 +08:00
|
|
|
|
public void TestDrumroll([Values] bool withKiai)
|
2020-04-15 15:29:39 +08:00
|
|
|
|
{
|
2022-11-23 03:28:41 +08:00
|
|
|
|
AddStep("set up beatmap", () => setUpBeatmap(withKiai));
|
|
|
|
|
|
2021-06-02 15:04:53 +08:00
|
|
|
|
AddStep("Drum roll", () => SetContents(_ =>
|
2020-04-15 15:29:39 +08:00
|
|
|
|
{
|
|
|
|
|
var hoc = new ScrollingHitObjectContainer();
|
|
|
|
|
|
|
|
|
|
hoc.Add(new DrawableDrumRoll(createDrumRollAtCurrentTime())
|
|
|
|
|
{
|
|
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
|
Origin = Anchor.Centre,
|
|
|
|
|
Width = 500,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
return hoc;
|
|
|
|
|
}));
|
|
|
|
|
|
2021-06-02 15:04:53 +08:00
|
|
|
|
AddStep("Drum roll (strong)", () => SetContents(_ =>
|
2020-04-15 15:29:39 +08:00
|
|
|
|
{
|
|
|
|
|
var hoc = new ScrollingHitObjectContainer();
|
|
|
|
|
|
|
|
|
|
hoc.Add(new DrawableDrumRoll(createDrumRollAtCurrentTime(true))
|
|
|
|
|
{
|
|
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
|
Origin = Anchor.Centre,
|
|
|
|
|
Width = 500,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
return hoc;
|
|
|
|
|
}));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private DrumRoll createDrumRollAtCurrentTime(bool strong = false)
|
|
|
|
|
{
|
|
|
|
|
var drumroll = new DrumRoll
|
|
|
|
|
{
|
|
|
|
|
IsStrong = strong,
|
|
|
|
|
StartTime = Time.Current + 1000,
|
|
|
|
|
Duration = 4000,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
var cpi = new ControlPointInfo();
|
|
|
|
|
cpi.Add(0, new TimingControlPoint { BeatLength = 500 });
|
|
|
|
|
|
|
|
|
|
drumroll.ApplyDefaults(cpi, new BeatmapDifficulty());
|
|
|
|
|
|
|
|
|
|
return drumroll;
|
|
|
|
|
}
|
2022-11-23 00:22:34 +08:00
|
|
|
|
|
2022-11-23 03:28:41 +08:00
|
|
|
|
private void setUpBeatmap(bool withKiai)
|
2022-11-23 00:22:34 +08:00
|
|
|
|
{
|
|
|
|
|
var controlPointInfo = new ControlPointInfo();
|
|
|
|
|
|
|
|
|
|
controlPointInfo.Add(0, new TimingControlPoint { BeatLength = 500 });
|
2022-11-23 03:28:41 +08:00
|
|
|
|
|
|
|
|
|
if (withKiai)
|
|
|
|
|
controlPointInfo.Add(0, new EffectControlPoint { KiaiMode = true });
|
2022-11-23 00:22:34 +08:00
|
|
|
|
|
|
|
|
|
Beatmap.Value = CreateWorkingBeatmap(new Beatmap
|
|
|
|
|
{
|
|
|
|
|
ControlPointInfo = controlPointInfo
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
Beatmap.Value.Track.Start();
|
|
|
|
|
}
|
2020-04-15 15:29:39 +08:00
|
|
|
|
}
|
|
|
|
|
}
|