1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-08 03:12:57 +08:00

Update to follow new naming/structure

This commit is contained in:
Dean Herbert 2020-03-06 00:36:05 +09:00
parent 5b8aaba4a6
commit ece263131b
2 changed files with 8 additions and 14 deletions

View File

@ -1,29 +1,28 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // 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. // See the LICENCE file in the repository root for full licence text.
using osu.Framework.Extensions.TypeExtensions;
using osu.Game.Beatmaps; using osu.Game.Beatmaps;
using osu.Game.Rulesets; using osu.Game.Rulesets;
using osu.Game.Rulesets.Mods; using osu.Game.Rulesets.Mods;
using osu.Game.Rulesets.Objects; using osu.Game.Rulesets.Objects;
using osu.Game.Scoring;
namespace osu.Game.Tests.Visual namespace osu.Game.Tests.Visual
{ {
public abstract class ModPerfectTestScene : ModSandboxTestScene public abstract class ModPerfectTestScene : ModTestScene
{ {
private readonly Ruleset ruleset; private readonly Ruleset ruleset;
private readonly ModPerfect perfectMod; private readonly ModPerfect mod;
protected ModPerfectTestScene(Ruleset ruleset, ModPerfect perfectMod) protected ModPerfectTestScene(Ruleset ruleset, ModPerfect mod)
: base(ruleset) : base(ruleset)
{ {
this.ruleset = ruleset; this.ruleset = ruleset;
this.perfectMod = perfectMod; this.mod = mod;
} }
protected void CreateHitObjectTest(HitObjectTestCase testCaseData, bool shouldMiss) => CreateModTest(new ModTestCaseData(testCaseData.HitObject.GetType().ReadableName(), perfectMod) protected void CreateHitObjectTest(HitObjectTestCase testCaseData, bool shouldMiss) => CreateModTest(new ModTestData
{ {
Mod = mod,
Beatmap = new Beatmap Beatmap = new Beatmap
{ {
BeatmapInfo = { Ruleset = ruleset.RulesetInfo }, BeatmapInfo = { Ruleset = ruleset.RulesetInfo },
@ -33,15 +32,10 @@ namespace osu.Game.Tests.Visual
PassCondition = () => ((PerfectModTestPlayer)Player).CheckFailed(shouldMiss && testCaseData.FailOnMiss) PassCondition = () => ((PerfectModTestPlayer)Player).CheckFailed(shouldMiss && testCaseData.FailOnMiss)
}); });
protected sealed override TestPlayer CreateReplayPlayer(Score score) => new PerfectModTestPlayer(score); protected override TestPlayer CreatePlayer(Ruleset ruleset) => new PerfectModTestPlayer();
private class PerfectModTestPlayer : TestPlayer private class PerfectModTestPlayer : TestPlayer
{ {
public PerfectModTestPlayer(Score score)
: base(score)
{
}
protected override bool AllowFail => true; protected override bool AllowFail => true;
public bool CheckFailed(bool failed) public bool CheckFailed(bool failed)

View File

@ -46,7 +46,7 @@ namespace osu.Game.Tests.Visual
protected sealed override IBeatmap CreateBeatmap(RulesetInfo ruleset) => currentTestData?.Beatmap ?? base.CreateBeatmap(ruleset); protected sealed override IBeatmap CreateBeatmap(RulesetInfo ruleset) => currentTestData?.Beatmap ?? base.CreateBeatmap(ruleset);
protected sealed override TestPlayer CreatePlayer(Ruleset ruleset) protected override TestPlayer CreatePlayer(Ruleset ruleset)
{ {
var mods = new List<Mod>(SelectedMods.Value); var mods = new List<Mod>(SelectedMods.Value);