diff --git a/osu.Game.Rulesets.Mania.Tests/Mods/TestSceneManiaModHoldOff.cs b/osu.Game.Rulesets.Mania.Tests/Mods/TestSceneManiaModHoldOff.cs index 3011a93755..f5117b61af 100644 --- a/osu.Game.Rulesets.Mania.Tests/Mods/TestSceneManiaModHoldOff.cs +++ b/osu.Game.Rulesets.Mania.Tests/Mods/TestSceneManiaModHoldOff.cs @@ -6,7 +6,6 @@ using NUnit.Framework; using osu.Game.Beatmaps; using osu.Game.Rulesets.Mania.Mods; using osu.Game.Tests.Visual; -using System.Collections.Generic; using osu.Game.Rulesets.Mania.Objects; using osu.Game.Beatmaps.ControlPoints; using osu.Game.Rulesets.Mania.Beatmaps; @@ -24,21 +23,6 @@ namespace osu.Game.Rulesets.Mania.Tests.Mods Assert.False(testBeatmap.HitObjects.OfType().Any()); } - [Test] - public void TestCorrectNoteValues() - { - var testBeatmap = createRawBeatmap(); - var noteValues = new List(testBeatmap.HitObjects.OfType().Count()); - - foreach (HoldNote h in testBeatmap.HitObjects.OfType()) - { - noteValues.Add(ManiaModHoldOff.GetNoteDurationInBeatLength(h, testBeatmap)); - } - - noteValues.Sort(); - Assert.AreEqual(noteValues, new List { 0.125, 0.250, 0.500, 1.000, 2.000 }); - } - [Test] public void TestCorrectObjectCount() { @@ -47,25 +31,8 @@ namespace osu.Game.Rulesets.Mania.Tests.Mods var rawBeatmap = createRawBeatmap(); var testBeatmap = createModdedBeatmap(); - // Calculate expected number of objects - int expectedObjectCount = 0; - - foreach (ManiaHitObject h in rawBeatmap.HitObjects) - { - // Both notes and hold notes account for at least one object - expectedObjectCount++; - - if (h.GetType() == typeof(HoldNote)) - { - double noteValue = ManiaModHoldOff.GetNoteDurationInBeatLength((HoldNote)h, rawBeatmap); - - if (noteValue >= ManiaModHoldOff.END_NOTE_ALLOW_THRESHOLD) - { - // Should generate an end note if it's longer than the minimum note value - expectedObjectCount++; - } - } - } + // Both notes and hold notes account for at least one object + int expectedObjectCount = rawBeatmap.HitObjects.Count; Assert.That(testBeatmap.HitObjects.Count == expectedObjectCount); } diff --git a/osu.Game.Rulesets.Mania/Mods/ManiaModHoldOff.cs b/osu.Game.Rulesets.Mania/Mods/ManiaModHoldOff.cs index 2b0098744f..4e6cc4f1d6 100644 --- a/osu.Game.Rulesets.Mania/Mods/ManiaModHoldOff.cs +++ b/osu.Game.Rulesets.Mania/Mods/ManiaModHoldOff.cs @@ -29,8 +29,6 @@ namespace osu.Game.Rulesets.Mania.Mods public override Type[] IncompatibleMods => new[] { typeof(ManiaModInvert) }; - public const double END_NOTE_ALLOW_THRESHOLD = 0.5; - public void ApplyToBeatmap(IBeatmap beatmap) { var maniaBeatmap = (ManiaBeatmap)beatmap; @@ -46,28 +44,9 @@ namespace osu.Game.Rulesets.Mania.Mods StartTime = h.StartTime, Samples = h.GetNodeSamples(0) }); - - // Don't add an end note if the duration is shorter than the threshold - double noteValue = GetNoteDurationInBeatLength(h, maniaBeatmap); // 1/1, 1/2, 1/4, etc. - - if (noteValue >= END_NOTE_ALLOW_THRESHOLD) - { - newObjects.Add(new Note - { - Column = h.Column, - StartTime = h.EndTime, - Samples = h.GetNodeSamples((h.NodeSamples?.Count - 1) ?? 1) - }); - } } maniaBeatmap.HitObjects = maniaBeatmap.HitObjects.OfType().Concat(newObjects).OrderBy(h => h.StartTime).ToList(); } - - public static double GetNoteDurationInBeatLength(HoldNote holdNote, ManiaBeatmap beatmap) - { - double beatLength = beatmap.ControlPointInfo.TimingPointAt(holdNote.StartTime).BeatLength; - return holdNote.Duration / beatLength; - } } }