2021-06-11 10:14:28 +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-07-20 13:53:27 +00:00
|
|
|
using System;
|
|
|
|
using System.Collections.Generic;
|
2021-06-11 10:14:28 +00:00
|
|
|
using System.Linq;
|
|
|
|
using NUnit.Framework;
|
2023-07-20 13:53:27 +00:00
|
|
|
using osu.Game.Beatmaps;
|
|
|
|
using osu.Game.Beatmaps.ControlPoints;
|
2021-06-11 10:14:28 +00:00
|
|
|
using osu.Game.Rulesets.Taiko.Mods;
|
2023-07-20 13:53:27 +00:00
|
|
|
using osu.Game.Rulesets.Taiko.Objects;
|
2021-06-11 10:14:28 +00:00
|
|
|
|
|
|
|
namespace osu.Game.Rulesets.Taiko.Tests.Mods
|
|
|
|
{
|
|
|
|
public partial class TestSceneTaikoModHidden : TaikoModTestScene
|
|
|
|
{
|
2023-07-20 13:53:27 +00:00
|
|
|
private Func<bool> checkAllMaxResultJudgements(int count) => ()
|
|
|
|
=> Player.ScoreProcessor.JudgedHits >= count
|
|
|
|
&& Player.Results.All(result => result.Type == result.Judgement.MaxResult);
|
|
|
|
|
2021-06-11 10:14:28 +00:00
|
|
|
[Test]
|
|
|
|
public void TestDefaultBeatmapTest() => CreateModTest(new ModTestData
|
|
|
|
{
|
|
|
|
Mod = new TaikoModHidden(),
|
|
|
|
Autoplay = true,
|
2023-07-20 13:53:27 +00:00
|
|
|
PassCondition = checkAllMaxResultJudgements(4),
|
2021-06-11 10:14:28 +00:00
|
|
|
});
|
|
|
|
|
2023-07-20 13:53:27 +00:00
|
|
|
[Test]
|
|
|
|
public void TestHitTwoNotesWithinShortPeriod()
|
|
|
|
{
|
|
|
|
const double hit_time = 1;
|
|
|
|
|
|
|
|
var beatmap = new Beatmap<TaikoHitObject>
|
|
|
|
{
|
|
|
|
HitObjects = new List<TaikoHitObject>
|
|
|
|
{
|
|
|
|
new Hit
|
|
|
|
{
|
|
|
|
Type = HitType.Rim,
|
|
|
|
StartTime = hit_time,
|
|
|
|
},
|
|
|
|
new Hit
|
|
|
|
{
|
|
|
|
Type = HitType.Centre,
|
|
|
|
StartTime = hit_time * 2,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
BeatmapInfo =
|
|
|
|
{
|
|
|
|
Difficulty = new BeatmapDifficulty
|
|
|
|
{
|
|
|
|
SliderTickRate = 4,
|
|
|
|
OverallDifficulty = 0,
|
|
|
|
},
|
|
|
|
Ruleset = new TaikoRuleset().RulesetInfo
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
beatmap.ControlPointInfo.Add(0, new EffectControlPoint { ScrollSpeed = 0.1f });
|
|
|
|
|
|
|
|
CreateModTest(new ModTestData
|
|
|
|
{
|
|
|
|
Mod = new TaikoModHidden(),
|
|
|
|
Autoplay = true,
|
|
|
|
PassCondition = checkAllMaxResultJudgements(2),
|
|
|
|
Beatmap = beatmap,
|
|
|
|
});
|
|
|
|
}
|
2021-06-11 10:14:28 +00:00
|
|
|
}
|
|
|
|
}
|