2019-09-15 20:55:25 +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.
|
|
|
|
|
|
|
|
|
|
using System;
|
|
|
|
|
using NUnit.Framework;
|
|
|
|
|
using osu.Game.Beatmaps.Legacy;
|
|
|
|
|
using osu.Game.Rulesets.Catch.Mods;
|
2023-07-09 14:09:25 +00:00
|
|
|
|
using osu.Game.Rulesets.Mods;
|
2019-09-15 20:55:25 +00:00
|
|
|
|
using osu.Game.Tests.Beatmaps;
|
|
|
|
|
|
|
|
|
|
namespace osu.Game.Rulesets.Catch.Tests
|
|
|
|
|
{
|
|
|
|
|
[TestFixture]
|
|
|
|
|
public class CatchLegacyModConversionTest : LegacyModConversionTest
|
|
|
|
|
{
|
2020-11-15 13:53:25 +00:00
|
|
|
|
private static readonly object[][] catch_mod_mapping =
|
|
|
|
|
{
|
|
|
|
|
new object[] { LegacyMods.NoFail, new[] { typeof(CatchModNoFail) } },
|
|
|
|
|
new object[] { LegacyMods.Easy, new[] { typeof(CatchModEasy) } },
|
|
|
|
|
new object[] { LegacyMods.Hidden, new[] { typeof(CatchModHidden) } },
|
|
|
|
|
new object[] { LegacyMods.HardRock, new[] { typeof(CatchModHardRock) } },
|
|
|
|
|
new object[] { LegacyMods.SuddenDeath, new[] { typeof(CatchModSuddenDeath) } },
|
|
|
|
|
new object[] { LegacyMods.DoubleTime, new[] { typeof(CatchModDoubleTime) } },
|
|
|
|
|
new object[] { LegacyMods.Relax, new[] { typeof(CatchModRelax) } },
|
|
|
|
|
new object[] { LegacyMods.HalfTime, new[] { typeof(CatchModHalfTime) } },
|
|
|
|
|
new object[] { LegacyMods.Flashlight, new[] { typeof(CatchModFlashlight) } },
|
|
|
|
|
new object[] { LegacyMods.Autoplay, new[] { typeof(CatchModAutoplay) } },
|
2023-07-09 14:09:25 +00:00
|
|
|
|
new object[] { LegacyMods.HardRock | LegacyMods.DoubleTime, new[] { typeof(CatchModHardRock), typeof(CatchModDoubleTime) } },
|
|
|
|
|
new object[] { LegacyMods.ScoreV2, new[] { typeof(ModScoreV2) } },
|
2020-11-15 13:53:25 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
[TestCaseSource(nameof(catch_mod_mapping))]
|
2022-06-30 03:37:03 +00:00
|
|
|
|
[TestCase(LegacyMods.Cinema, new[] { typeof(CatchModCinema) })]
|
2020-11-15 13:53:25 +00:00
|
|
|
|
[TestCase(LegacyMods.Cinema | LegacyMods.Autoplay, new[] { typeof(CatchModCinema) })]
|
2022-06-30 03:37:03 +00:00
|
|
|
|
[TestCase(LegacyMods.Nightcore, new[] { typeof(CatchModNightcore) })]
|
2019-09-15 20:55:25 +00:00
|
|
|
|
[TestCase(LegacyMods.Nightcore | LegacyMods.DoubleTime, new[] { typeof(CatchModNightcore) })]
|
2022-06-30 03:37:03 +00:00
|
|
|
|
[TestCase(LegacyMods.Perfect, new[] { typeof(CatchModPerfect) })]
|
2019-09-15 20:55:25 +00:00
|
|
|
|
[TestCase(LegacyMods.Perfect | LegacyMods.SuddenDeath, new[] { typeof(CatchModPerfect) })]
|
2020-11-15 13:17:41 +00:00
|
|
|
|
public new void TestFromLegacy(LegacyMods legacyMods, Type[] expectedMods) => base.TestFromLegacy(legacyMods, expectedMods);
|
2019-09-15 20:55:25 +00:00
|
|
|
|
|
2020-11-15 13:53:25 +00:00
|
|
|
|
[TestCaseSource(nameof(catch_mod_mapping))]
|
2022-06-30 03:37:03 +00:00
|
|
|
|
[TestCase(LegacyMods.Cinema | LegacyMods.Autoplay, new[] { typeof(CatchModCinema) })]
|
|
|
|
|
[TestCase(LegacyMods.Nightcore | LegacyMods.DoubleTime, new[] { typeof(CatchModNightcore) })]
|
|
|
|
|
[TestCase(LegacyMods.Perfect | LegacyMods.SuddenDeath, new[] { typeof(CatchModPerfect) })]
|
2020-11-15 13:53:25 +00:00
|
|
|
|
public new void TestToLegacy(LegacyMods legacyMods, Type[] givenMods) => base.TestToLegacy(legacyMods, givenMods);
|
|
|
|
|
|
2019-09-15 20:55:25 +00:00
|
|
|
|
protected override Ruleset CreateRuleset() => new CatchRuleset();
|
|
|
|
|
}
|
|
|
|
|
}
|