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;
|
2023-07-09 14:09:25 +00:00
|
|
|
|
using osu.Game.Rulesets.Mods;
|
2019-09-15 20:55:25 +00:00
|
|
|
|
using osu.Game.Rulesets.Osu.Mods;
|
|
|
|
|
using osu.Game.Tests.Beatmaps;
|
|
|
|
|
|
|
|
|
|
namespace osu.Game.Rulesets.Osu.Tests
|
|
|
|
|
{
|
|
|
|
|
[TestFixture]
|
|
|
|
|
public class OsuLegacyModConversionTest : LegacyModConversionTest
|
|
|
|
|
{
|
2020-11-15 14:16:17 +00:00
|
|
|
|
private static readonly object[][] osu_mod_mapping =
|
|
|
|
|
{
|
|
|
|
|
new object[] { LegacyMods.NoFail, new[] { typeof(OsuModNoFail) } },
|
|
|
|
|
new object[] { LegacyMods.Easy, new[] { typeof(OsuModEasy) } },
|
|
|
|
|
new object[] { LegacyMods.TouchDevice, new[] { typeof(OsuModTouchDevice) } },
|
|
|
|
|
new object[] { LegacyMods.Hidden, new[] { typeof(OsuModHidden) } },
|
|
|
|
|
new object[] { LegacyMods.HardRock, new[] { typeof(OsuModHardRock) } },
|
|
|
|
|
new object[] { LegacyMods.SuddenDeath, new[] { typeof(OsuModSuddenDeath) } },
|
|
|
|
|
new object[] { LegacyMods.DoubleTime, new[] { typeof(OsuModDoubleTime) } },
|
|
|
|
|
new object[] { LegacyMods.Relax, new[] { typeof(OsuModRelax) } },
|
|
|
|
|
new object[] { LegacyMods.HalfTime, new[] { typeof(OsuModHalfTime) } },
|
|
|
|
|
new object[] { LegacyMods.Flashlight, new[] { typeof(OsuModFlashlight) } },
|
|
|
|
|
new object[] { LegacyMods.Autoplay, new[] { typeof(OsuModAutoplay) } },
|
|
|
|
|
new object[] { LegacyMods.SpunOut, new[] { typeof(OsuModSpunOut) } },
|
|
|
|
|
new object[] { LegacyMods.Autopilot, new[] { typeof(OsuModAutopilot) } },
|
2022-11-01 10:47:20 +00:00
|
|
|
|
new object[] { LegacyMods.Target, new[] { typeof(OsuModTargetPractice) } },
|
2023-07-09 14:09:25 +00:00
|
|
|
|
new object[] { LegacyMods.HardRock | LegacyMods.DoubleTime, new[] { typeof(OsuModHardRock), typeof(OsuModDoubleTime) } },
|
|
|
|
|
new object[] { LegacyMods.ScoreV2, new[] { typeof(ModScoreV2) } },
|
2020-11-15 14:16:17 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
[TestCaseSource(nameof(osu_mod_mapping))]
|
2022-06-30 03:37:03 +00:00
|
|
|
|
[TestCase(LegacyMods.Cinema, new[] { typeof(OsuModCinema) })]
|
2020-11-15 14:16:17 +00:00
|
|
|
|
[TestCase(LegacyMods.Cinema | LegacyMods.Autoplay, new[] { typeof(OsuModCinema) })]
|
2022-06-30 03:37:03 +00:00
|
|
|
|
[TestCase(LegacyMods.Nightcore, new[] { typeof(OsuModNightcore) })]
|
2019-09-15 20:55:25 +00:00
|
|
|
|
[TestCase(LegacyMods.Nightcore | LegacyMods.DoubleTime, new[] { typeof(OsuModNightcore) })]
|
2022-06-30 03:37:03 +00:00
|
|
|
|
[TestCase(LegacyMods.Perfect, new[] { typeof(OsuModPerfect) })]
|
2019-09-15 20:55:25 +00:00
|
|
|
|
[TestCase(LegacyMods.Perfect | LegacyMods.SuddenDeath, new[] { typeof(OsuModPerfect) })]
|
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 14:16:17 +00:00
|
|
|
|
[TestCaseSource(nameof(osu_mod_mapping))]
|
2022-06-30 03:37:03 +00:00
|
|
|
|
[TestCase(LegacyMods.Cinema | LegacyMods.Autoplay, new[] { typeof(OsuModCinema) })]
|
|
|
|
|
[TestCase(LegacyMods.Nightcore | LegacyMods.DoubleTime, new[] { typeof(OsuModNightcore) })]
|
|
|
|
|
[TestCase(LegacyMods.Perfect | LegacyMods.SuddenDeath, new[] { typeof(OsuModPerfect) })]
|
2020-11-15 14:16:17 +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 OsuRuleset();
|
|
|
|
|
}
|
|
|
|
|
}
|