2019-09-16 04:55:25 +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.
|
|
|
|
|
|
|
|
|
|
using System;
|
|
|
|
|
using NUnit.Framework;
|
|
|
|
|
using osu.Game.Beatmaps.Legacy;
|
2023-07-09 22:09:25 +08:00
|
|
|
|
using osu.Game.Rulesets.Mods;
|
2019-09-16 04:55:25 +08:00
|
|
|
|
using osu.Game.Rulesets.Taiko.Mods;
|
|
|
|
|
using osu.Game.Tests.Beatmaps;
|
|
|
|
|
|
|
|
|
|
namespace osu.Game.Rulesets.Taiko.Tests
|
|
|
|
|
{
|
|
|
|
|
[TestFixture]
|
|
|
|
|
public class TaikoLegacyModConversionTest : LegacyModConversionTest
|
|
|
|
|
{
|
2020-11-15 22:24:57 +08:00
|
|
|
|
private static readonly object[][] taiko_mod_mapping =
|
|
|
|
|
{
|
|
|
|
|
new object[] { LegacyMods.NoFail, new[] { typeof(TaikoModNoFail) } },
|
|
|
|
|
new object[] { LegacyMods.Easy, new[] { typeof(TaikoModEasy) } },
|
|
|
|
|
new object[] { LegacyMods.Hidden, new[] { typeof(TaikoModHidden) } },
|
|
|
|
|
new object[] { LegacyMods.HardRock, new[] { typeof(TaikoModHardRock) } },
|
|
|
|
|
new object[] { LegacyMods.SuddenDeath, new[] { typeof(TaikoModSuddenDeath) } },
|
|
|
|
|
new object[] { LegacyMods.DoubleTime, new[] { typeof(TaikoModDoubleTime) } },
|
|
|
|
|
new object[] { LegacyMods.Relax, new[] { typeof(TaikoModRelax) } },
|
|
|
|
|
new object[] { LegacyMods.HalfTime, new[] { typeof(TaikoModHalfTime) } },
|
|
|
|
|
new object[] { LegacyMods.Flashlight, new[] { typeof(TaikoModFlashlight) } },
|
|
|
|
|
new object[] { LegacyMods.Autoplay, new[] { typeof(TaikoModAutoplay) } },
|
2023-07-09 22:09:25 +08:00
|
|
|
|
new object[] { LegacyMods.HardRock | LegacyMods.DoubleTime, new[] { typeof(TaikoModHardRock), typeof(TaikoModDoubleTime) } },
|
|
|
|
|
new object[] { LegacyMods.ScoreV2, new[] { typeof(ModScoreV2) } },
|
2020-11-15 22:24:57 +08:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
[TestCaseSource(nameof(taiko_mod_mapping))]
|
2022-06-30 11:37:03 +08:00
|
|
|
|
[TestCase(LegacyMods.Cinema, new[] { typeof(TaikoModCinema) })]
|
2020-11-15 22:24:57 +08:00
|
|
|
|
[TestCase(LegacyMods.Cinema | LegacyMods.Autoplay, new[] { typeof(TaikoModCinema) })]
|
2022-06-30 11:37:03 +08:00
|
|
|
|
[TestCase(LegacyMods.Nightcore, new[] { typeof(TaikoModNightcore) })]
|
2019-09-16 04:55:25 +08:00
|
|
|
|
[TestCase(LegacyMods.Nightcore | LegacyMods.DoubleTime, new[] { typeof(TaikoModNightcore) })]
|
2022-06-30 11:37:03 +08:00
|
|
|
|
[TestCase(LegacyMods.Perfect, new[] { typeof(TaikoModPerfect) })]
|
2019-09-16 04:55:25 +08:00
|
|
|
|
[TestCase(LegacyMods.Perfect | LegacyMods.SuddenDeath, new[] { typeof(TaikoModPerfect) })]
|
2020-11-15 21:17:41 +08:00
|
|
|
|
public new void TestFromLegacy(LegacyMods legacyMods, Type[] expectedMods) => base.TestFromLegacy(legacyMods, expectedMods);
|
2019-09-16 04:55:25 +08:00
|
|
|
|
|
2020-11-15 22:24:57 +08:00
|
|
|
|
[TestCaseSource(nameof(taiko_mod_mapping))]
|
2022-06-30 11:37:03 +08:00
|
|
|
|
[TestCase(LegacyMods.Cinema | LegacyMods.Autoplay, new[] { typeof(TaikoModCinema) })]
|
|
|
|
|
[TestCase(LegacyMods.Nightcore | LegacyMods.DoubleTime, new[] { typeof(TaikoModNightcore) })]
|
|
|
|
|
[TestCase(LegacyMods.Perfect | LegacyMods.SuddenDeath, new[] { typeof(TaikoModPerfect) })]
|
2020-11-15 22:24:57 +08:00
|
|
|
|
public new void TestToLegacy(LegacyMods legacyMods, Type[] givenMods) => base.TestToLegacy(legacyMods, givenMods);
|
|
|
|
|
|
2019-09-16 04:55:25 +08:00
|
|
|
|
protected override Ruleset CreateRuleset() => new TaikoRuleset();
|
|
|
|
|
}
|
|
|
|
|
}
|