2019-06-21 05:29:16 +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
|
|
|
|
|
2019-06-21 05:29:16 +00:00
|
|
|
using System.Linq;
|
|
|
|
using NUnit.Framework;
|
|
|
|
using osu.Game.Beatmaps;
|
|
|
|
using osu.Game.Rulesets.Taiko.Beatmaps;
|
|
|
|
using osu.Game.Rulesets.Taiko.Mods;
|
|
|
|
using osu.Game.Rulesets.Taiko.Objects;
|
|
|
|
using osu.Game.Tests.Visual;
|
|
|
|
|
|
|
|
namespace osu.Game.Rulesets.Taiko.Tests
|
|
|
|
{
|
2020-04-17 07:32:12 +00:00
|
|
|
public class TestSceneTaikoSuddenDeath : TestSceneTaikoPlayer
|
2019-06-21 05:29:16 +00:00
|
|
|
{
|
|
|
|
protected override bool AllowFail => true;
|
|
|
|
|
2020-03-05 02:25:07 +00:00
|
|
|
protected override TestPlayer CreatePlayer(Ruleset ruleset)
|
2019-06-21 07:37:06 +00:00
|
|
|
{
|
2019-12-13 12:45:38 +00:00
|
|
|
SelectedMods.Value = SelectedMods.Value.Concat(new[] { new TaikoModSuddenDeath() }).ToArray();
|
2020-03-05 02:25:07 +00:00
|
|
|
return base.CreatePlayer(ruleset);
|
2019-06-21 07:37:06 +00:00
|
|
|
}
|
2019-06-21 05:29:16 +00:00
|
|
|
|
|
|
|
protected override IBeatmap CreateBeatmap(RulesetInfo ruleset) =>
|
|
|
|
new TaikoBeatmap
|
|
|
|
{
|
|
|
|
HitObjects =
|
|
|
|
{
|
|
|
|
new Swell { StartTime = 1500 },
|
|
|
|
new Hit { StartTime = 100000 },
|
|
|
|
},
|
|
|
|
BeatmapInfo =
|
|
|
|
{
|
|
|
|
Ruleset = new TaikoRuleset().RulesetInfo
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
[Test]
|
2022-08-05 14:30:07 +00:00
|
|
|
public void TestSwellDoesNotFail()
|
2019-06-21 05:29:16 +00:00
|
|
|
{
|
|
|
|
bool judged = false;
|
|
|
|
AddStep("Setup judgements", () =>
|
|
|
|
{
|
|
|
|
judged = false;
|
2022-06-24 12:25:23 +00:00
|
|
|
Player.ScoreProcessor.NewJudgement += _ => judged = true;
|
2019-06-21 05:29:16 +00:00
|
|
|
});
|
|
|
|
AddUntilStep("swell judged", () => judged);
|
2022-08-05 14:30:07 +00:00
|
|
|
AddAssert("not failed", () => !Player.GameplayState.HasFailed);
|
2019-06-21 05:29:16 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|