2020-03-02 03:42:48 +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.
|
|
|
|
|
2023-12-22 04:38:52 +00:00
|
|
|
using System.Collections.Generic;
|
2020-03-02 03:42:48 +00:00
|
|
|
using NUnit.Framework;
|
2023-12-22 04:38:52 +00:00
|
|
|
using osu.Game.Beatmaps;
|
2020-03-02 03:42:48 +00:00
|
|
|
using osu.Game.Rulesets.Objects;
|
|
|
|
using osu.Game.Rulesets.Objects.Types;
|
|
|
|
using osu.Game.Rulesets.Osu.Mods;
|
|
|
|
using osu.Game.Rulesets.Osu.Objects;
|
2023-12-22 04:38:52 +00:00
|
|
|
using osu.Game.Rulesets.Osu.Replays;
|
|
|
|
using osu.Game.Rulesets.Replays;
|
2020-03-02 03:42:48 +00:00
|
|
|
using osu.Game.Tests.Visual;
|
|
|
|
using osuTK;
|
|
|
|
|
2020-03-03 06:30:53 +00:00
|
|
|
namespace osu.Game.Rulesets.Osu.Tests.Mods
|
2020-03-02 03:42:48 +00:00
|
|
|
{
|
2023-12-22 07:43:09 +00:00
|
|
|
public partial class TestSceneOsuModPerfect : ModFailConditionTestScene
|
2020-03-02 03:42:48 +00:00
|
|
|
{
|
2020-04-23 10:25:06 +00:00
|
|
|
protected override Ruleset CreatePlayerRuleset() => new OsuRuleset();
|
|
|
|
|
2020-03-02 03:42:48 +00:00
|
|
|
public TestSceneOsuModPerfect()
|
2020-04-17 07:56:01 +00:00
|
|
|
: base(new OsuModPerfect())
|
2020-03-02 03:42:48 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
[TestCase(false)]
|
|
|
|
[TestCase(true)]
|
2020-03-10 15:36:56 +00:00
|
|
|
public void TestHitCircle(bool shouldMiss) => CreateHitObjectTest(new HitObjectTestData(new HitCircle { StartTime = 1000 }), shouldMiss);
|
2020-03-02 03:42:48 +00:00
|
|
|
|
|
|
|
[TestCase(false)]
|
|
|
|
[TestCase(true)]
|
|
|
|
public void TestSlider(bool shouldMiss)
|
|
|
|
{
|
|
|
|
var slider = new Slider
|
|
|
|
{
|
|
|
|
StartTime = 1000,
|
2023-11-08 10:43:54 +00:00
|
|
|
Path = new SliderPath(PathType.LINEAR, new[] { Vector2.Zero, new Vector2(100, 0), })
|
2020-03-02 03:42:48 +00:00
|
|
|
};
|
|
|
|
|
2020-03-10 15:36:56 +00:00
|
|
|
CreateHitObjectTest(new HitObjectTestData(slider), shouldMiss);
|
2020-03-02 03:42:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
[TestCase(false)]
|
|
|
|
[TestCase(true)]
|
|
|
|
public void TestSpinner(bool shouldMiss)
|
|
|
|
{
|
|
|
|
var spinner = new Spinner
|
|
|
|
{
|
|
|
|
StartTime = 1000,
|
|
|
|
EndTime = 3000,
|
|
|
|
Position = new Vector2(256, 192)
|
|
|
|
};
|
|
|
|
|
2020-03-10 15:36:56 +00:00
|
|
|
CreateHitObjectTest(new HitObjectTestData(spinner), shouldMiss);
|
2020-03-02 03:42:48 +00:00
|
|
|
}
|
2023-12-22 04:38:52 +00:00
|
|
|
|
|
|
|
[Test]
|
|
|
|
public void TestMissSliderTail() => CreateModTest(new ModTestData
|
|
|
|
{
|
|
|
|
Mod = new OsuModPerfect(),
|
2023-12-22 07:43:09 +00:00
|
|
|
PassCondition = () => ((ModFailConditionTestPlayer)Player).CheckFailed(true),
|
2023-12-22 04:38:52 +00:00
|
|
|
Autoplay = false,
|
|
|
|
Beatmap = new Beatmap
|
|
|
|
{
|
|
|
|
HitObjects = new List<HitObject>
|
|
|
|
{
|
|
|
|
new Slider
|
|
|
|
{
|
|
|
|
Position = new Vector2(256, 192),
|
|
|
|
StartTime = 1000,
|
|
|
|
Path = new SliderPath(PathType.LINEAR, new[] { Vector2.Zero, new Vector2(100, 0), })
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
ReplayFrames = new List<ReplayFrame>
|
|
|
|
{
|
|
|
|
new OsuReplayFrame(1000, new Vector2(256, 192), OsuAction.LeftButton),
|
|
|
|
new OsuReplayFrame(1001, new Vector2(256, 192)),
|
|
|
|
}
|
|
|
|
});
|
2020-03-02 03:42:48 +00:00
|
|
|
}
|
|
|
|
}
|