2020-03-02 11:42:48 +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.
|
|
|
|
|
2023-12-22 12:38:52 +08:00
|
|
|
using System.Collections.Generic;
|
2020-03-02 11:42:48 +08:00
|
|
|
using NUnit.Framework;
|
2023-12-22 12:38:52 +08:00
|
|
|
using osu.Game.Beatmaps;
|
2020-03-02 11:42:48 +08:00
|
|
|
using osu.Game.Rulesets.Mania.Mods;
|
|
|
|
using osu.Game.Rulesets.Mania.Objects;
|
2023-12-22 12:38:52 +08:00
|
|
|
using osu.Game.Rulesets.Mania.Replays;
|
|
|
|
using osu.Game.Rulesets.Objects;
|
|
|
|
using osu.Game.Rulesets.Replays;
|
2020-03-02 11:42:48 +08:00
|
|
|
using osu.Game.Tests.Visual;
|
|
|
|
|
2020-03-03 14:30:53 +08:00
|
|
|
namespace osu.Game.Rulesets.Mania.Tests.Mods
|
2020-03-02 11:42:48 +08:00
|
|
|
{
|
2023-12-22 15:43:09 +08:00
|
|
|
public partial class TestSceneManiaModPerfect : ModFailConditionTestScene
|
2020-03-02 11:42:48 +08:00
|
|
|
{
|
2020-04-23 18:25:06 +08:00
|
|
|
protected override Ruleset CreatePlayerRuleset() => new ManiaRuleset();
|
|
|
|
|
2020-03-02 11:42:48 +08:00
|
|
|
public TestSceneManiaModPerfect()
|
2020-04-17 15:56:01 +08:00
|
|
|
: base(new ManiaModPerfect())
|
2020-03-02 11:42:48 +08:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
[TestCase(false)]
|
|
|
|
[TestCase(true)]
|
2020-03-10 23:36:56 +08:00
|
|
|
public void TestNote(bool shouldMiss) => CreateHitObjectTest(new HitObjectTestData(new Note { StartTime = 1000 }), shouldMiss);
|
2020-03-02 11:42:48 +08:00
|
|
|
|
|
|
|
[TestCase(false)]
|
|
|
|
[TestCase(true)]
|
2020-03-10 23:36:56 +08:00
|
|
|
public void TestHoldNote(bool shouldMiss) => CreateHitObjectTest(new HitObjectTestData(new HoldNote { StartTime = 1000, EndTime = 3000 }), shouldMiss);
|
2023-12-22 12:38:52 +08:00
|
|
|
|
2023-12-22 15:19:36 +08:00
|
|
|
[Test]
|
|
|
|
public void TestGreatHit() => CreateModTest(new ModTestData
|
|
|
|
{
|
|
|
|
Mod = new ManiaModPerfect(),
|
2023-12-22 15:43:09 +08:00
|
|
|
PassCondition = () => ((ModFailConditionTestPlayer)Player).CheckFailed(false),
|
2023-12-22 15:19:36 +08:00
|
|
|
Autoplay = false,
|
|
|
|
Beatmap = new Beatmap
|
|
|
|
{
|
|
|
|
HitObjects = new List<HitObject>
|
|
|
|
{
|
|
|
|
new Note
|
|
|
|
{
|
|
|
|
StartTime = 1000,
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
ReplayFrames = new List<ReplayFrame>
|
|
|
|
{
|
|
|
|
new ManiaReplayFrame(1020, ManiaAction.Key1),
|
|
|
|
new ManiaReplayFrame(2000)
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2023-12-22 12:38:52 +08:00
|
|
|
[Test]
|
|
|
|
public void TestBreakOnHoldNote() => CreateModTest(new ModTestData
|
|
|
|
{
|
|
|
|
Mod = new ManiaModPerfect(),
|
2023-12-22 15:43:09 +08:00
|
|
|
PassCondition = () => ((ModFailConditionTestPlayer)Player).CheckFailed(true) && Player.Results.Count == 2,
|
2023-12-22 12:38:52 +08:00
|
|
|
Autoplay = false,
|
|
|
|
Beatmap = new Beatmap
|
|
|
|
{
|
|
|
|
HitObjects = new List<HitObject>
|
|
|
|
{
|
|
|
|
new HoldNote
|
|
|
|
{
|
|
|
|
StartTime = 1000,
|
|
|
|
EndTime = 3000,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
ReplayFrames = new List<ReplayFrame>
|
|
|
|
{
|
|
|
|
new ManiaReplayFrame(1000, ManiaAction.Key1),
|
|
|
|
new ManiaReplayFrame(2000)
|
|
|
|
}
|
|
|
|
});
|
2020-03-02 11:42:48 +08:00
|
|
|
}
|
|
|
|
}
|