mirror of
https://github.com/osukey/osukey.git
synced 2025-05-15 02:27:33 +09:00
Remove PlayerTestScene
constructor and use CreateRuleset
method instead
This commit is contained in:
parent
5fa6bcb5a3
commit
92df4e3a9e
@ -12,13 +12,8 @@ using osuTK;
|
|||||||
|
|
||||||
namespace osu.Game.Rulesets.Catch.Tests
|
namespace osu.Game.Rulesets.Catch.Tests
|
||||||
{
|
{
|
||||||
public class TestSceneAutoJuiceStream : PlayerTestScene
|
public class TestSceneAutoJuiceStream : TestSceneCatchPlayer
|
||||||
{
|
{
|
||||||
public TestSceneAutoJuiceStream()
|
|
||||||
: base(new CatchRuleset())
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override IBeatmap CreateBeatmap(RulesetInfo ruleset)
|
protected override IBeatmap CreateBeatmap(RulesetInfo ruleset)
|
||||||
{
|
{
|
||||||
var beatmap = new Beatmap
|
var beatmap = new Beatmap
|
||||||
|
@ -8,12 +8,11 @@ using osu.Game.Beatmaps;
|
|||||||
using osu.Game.Rulesets.Catch.Objects;
|
using osu.Game.Rulesets.Catch.Objects;
|
||||||
using osu.Game.Rulesets.Catch.Objects.Drawables;
|
using osu.Game.Rulesets.Catch.Objects.Drawables;
|
||||||
using osu.Game.Rulesets.Catch.UI;
|
using osu.Game.Rulesets.Catch.UI;
|
||||||
using osu.Game.Tests.Visual;
|
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Catch.Tests
|
namespace osu.Game.Rulesets.Catch.Tests
|
||||||
{
|
{
|
||||||
[TestFixture]
|
[TestFixture]
|
||||||
public class TestSceneBananaShower : PlayerTestScene
|
public class TestSceneBananaShower : TestSceneCatchPlayer
|
||||||
{
|
{
|
||||||
public override IReadOnlyList<Type> RequiredTypes => new[]
|
public override IReadOnlyList<Type> RequiredTypes => new[]
|
||||||
{
|
{
|
||||||
@ -26,11 +25,6 @@ namespace osu.Game.Rulesets.Catch.Tests
|
|||||||
typeof(DrawableCatchRuleset),
|
typeof(DrawableCatchRuleset),
|
||||||
};
|
};
|
||||||
|
|
||||||
public TestSceneBananaShower()
|
|
||||||
: base(new CatchRuleset())
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void TestBananaShower()
|
public void TestBananaShower()
|
||||||
{
|
{
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
// 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 System;
|
||||||
|
using System.Collections.Generic;
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
using osu.Game.Tests.Visual;
|
using osu.Game.Tests.Visual;
|
||||||
|
|
||||||
@ -9,9 +11,11 @@ namespace osu.Game.Rulesets.Catch.Tests
|
|||||||
[TestFixture]
|
[TestFixture]
|
||||||
public class TestSceneCatchPlayer : PlayerTestScene
|
public class TestSceneCatchPlayer : PlayerTestScene
|
||||||
{
|
{
|
||||||
public TestSceneCatchPlayer()
|
public override IReadOnlyList<Type> RequiredTypes => new[]
|
||||||
: base(new CatchRuleset())
|
|
||||||
{
|
{
|
||||||
}
|
typeof(CatchRuleset),
|
||||||
|
};
|
||||||
|
|
||||||
|
protected override Ruleset CreateRuleset() => new CatchRuleset();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,18 +4,12 @@
|
|||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Rulesets.Catch.Objects;
|
using osu.Game.Rulesets.Catch.Objects;
|
||||||
using osu.Game.Tests.Visual;
|
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Catch.Tests
|
namespace osu.Game.Rulesets.Catch.Tests
|
||||||
{
|
{
|
||||||
[TestFixture]
|
[TestFixture]
|
||||||
public class TestSceneCatchStacker : PlayerTestScene
|
public class TestSceneCatchStacker : TestSceneCatchPlayer
|
||||||
{
|
{
|
||||||
public TestSceneCatchStacker()
|
|
||||||
: base(new CatchRuleset())
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override IBeatmap CreateBeatmap(RulesetInfo ruleset)
|
protected override IBeatmap CreateBeatmap(RulesetInfo ruleset)
|
||||||
{
|
{
|
||||||
var beatmap = new Beatmap
|
var beatmap = new Beatmap
|
||||||
|
@ -10,24 +10,18 @@ using osu.Game.Beatmaps;
|
|||||||
using osu.Game.Rulesets.Catch.Objects;
|
using osu.Game.Rulesets.Catch.Objects;
|
||||||
using osu.Game.Rulesets.Catch.UI;
|
using osu.Game.Rulesets.Catch.UI;
|
||||||
using osu.Game.Rulesets.Objects;
|
using osu.Game.Rulesets.Objects;
|
||||||
using osu.Game.Tests.Visual;
|
|
||||||
using osuTK;
|
using osuTK;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Catch.Tests
|
namespace osu.Game.Rulesets.Catch.Tests
|
||||||
{
|
{
|
||||||
[TestFixture]
|
[TestFixture]
|
||||||
public class TestSceneHyperDash : PlayerTestScene
|
public class TestSceneHyperDash : TestSceneCatchPlayer
|
||||||
{
|
{
|
||||||
public override IReadOnlyList<Type> RequiredTypes => new[]
|
public override IReadOnlyList<Type> RequiredTypes => new[]
|
||||||
{
|
{
|
||||||
typeof(CatcherArea),
|
typeof(CatcherArea),
|
||||||
};
|
};
|
||||||
|
|
||||||
public TestSceneHyperDash()
|
|
||||||
: base(new CatchRuleset())
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override bool Autoplay => true;
|
protected override bool Autoplay => true;
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
|
@ -7,18 +7,12 @@ using osu.Game.Beatmaps;
|
|||||||
using osu.Game.Rulesets.Catch.Objects;
|
using osu.Game.Rulesets.Catch.Objects;
|
||||||
using osu.Game.Rulesets.Objects;
|
using osu.Game.Rulesets.Objects;
|
||||||
using osu.Game.Rulesets.Objects.Types;
|
using osu.Game.Rulesets.Objects.Types;
|
||||||
using osu.Game.Tests.Visual;
|
|
||||||
using osuTK;
|
using osuTK;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Catch.Tests
|
namespace osu.Game.Rulesets.Catch.Tests
|
||||||
{
|
{
|
||||||
public class TestSceneJuiceStream : PlayerTestScene
|
public class TestSceneJuiceStream : TestSceneCatchPlayer
|
||||||
{
|
{
|
||||||
public TestSceneJuiceStream()
|
|
||||||
: base(new CatchRuleset())
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void TestJuiceStreamEndingCombo()
|
public void TestJuiceStreamEndingCombo()
|
||||||
{
|
{
|
||||||
|
19
osu.Game.Rulesets.Mania.Tests/TestSceneManiaPlayer.cs
Normal file
19
osu.Game.Rulesets.Mania.Tests/TestSceneManiaPlayer.cs
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
// 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 System.Collections.Generic;
|
||||||
|
using osu.Game.Tests.Visual;
|
||||||
|
|
||||||
|
namespace osu.Game.Rulesets.Mania.Tests
|
||||||
|
{
|
||||||
|
public class TestSceneManiaPlayer : PlayerTestScene
|
||||||
|
{
|
||||||
|
public override IReadOnlyList<Type> RequiredTypes => new[]
|
||||||
|
{
|
||||||
|
typeof(ManiaRuleset),
|
||||||
|
};
|
||||||
|
|
||||||
|
protected override Ruleset CreateRuleset() => new ManiaRuleset();
|
||||||
|
}
|
||||||
|
}
|
@ -1,15 +0,0 @@
|
|||||||
// 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 osu.Game.Tests.Visual;
|
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Mania.Tests
|
|
||||||
{
|
|
||||||
public class TestScenePlayer : PlayerTestScene
|
|
||||||
{
|
|
||||||
public TestScenePlayer()
|
|
||||||
: base(new ManiaRuleset())
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -4,19 +4,13 @@
|
|||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Rulesets.Osu.Objects;
|
using osu.Game.Rulesets.Osu.Objects;
|
||||||
using osu.Game.Tests.Visual;
|
|
||||||
using osuTK;
|
using osuTK;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Osu.Tests
|
namespace osu.Game.Rulesets.Osu.Tests
|
||||||
{
|
{
|
||||||
[TestFixture]
|
[TestFixture]
|
||||||
public class TestSceneHitCircleLongCombo : PlayerTestScene
|
public class TestSceneHitCircleLongCombo : TestSceneOsuPlayer
|
||||||
{
|
{
|
||||||
public TestSceneHitCircleLongCombo()
|
|
||||||
: base(new OsuRuleset())
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override IBeatmap CreateBeatmap(RulesetInfo ruleset)
|
protected override IBeatmap CreateBeatmap(RulesetInfo ruleset)
|
||||||
{
|
{
|
||||||
var beatmap = new Beatmap
|
var beatmap = new Beatmap
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
// 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 System;
|
||||||
|
using System.Collections.Generic;
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
using osu.Game.Tests.Visual;
|
using osu.Game.Tests.Visual;
|
||||||
|
|
||||||
@ -9,9 +11,11 @@ namespace osu.Game.Rulesets.Osu.Tests
|
|||||||
[TestFixture]
|
[TestFixture]
|
||||||
public class TestSceneOsuPlayer : PlayerTestScene
|
public class TestSceneOsuPlayer : PlayerTestScene
|
||||||
{
|
{
|
||||||
public TestSceneOsuPlayer()
|
public override IReadOnlyList<Type> RequiredTypes => new[]
|
||||||
: base(new OsuRuleset())
|
|
||||||
{
|
{
|
||||||
}
|
typeof(OsuRuleset),
|
||||||
|
};
|
||||||
|
|
||||||
|
protected override Ruleset CreateRuleset() => new OsuRuleset();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -25,13 +25,12 @@ using osu.Game.Tests.Visual;
|
|||||||
namespace osu.Game.Rulesets.Osu.Tests
|
namespace osu.Game.Rulesets.Osu.Tests
|
||||||
{
|
{
|
||||||
[TestFixture]
|
[TestFixture]
|
||||||
public class TestSceneSkinFallbacks : PlayerTestScene
|
public class TestSceneSkinFallbacks : TestSceneOsuPlayer
|
||||||
{
|
{
|
||||||
private readonly TestSource testUserSkin;
|
private readonly TestSource testUserSkin;
|
||||||
private readonly TestSource testBeatmapSkin;
|
private readonly TestSource testBeatmapSkin;
|
||||||
|
|
||||||
public TestSceneSkinFallbacks()
|
public TestSceneSkinFallbacks()
|
||||||
: base(new OsuRuleset())
|
|
||||||
{
|
{
|
||||||
testUserSkin = new TestSource("user");
|
testUserSkin = new TestSource("user");
|
||||||
testBeatmapSkin = new TestSource("beatmap");
|
testBeatmapSkin = new TestSource("beatmap");
|
||||||
|
@ -5,17 +5,11 @@ using System.Linq;
|
|||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Rulesets.Taiko.Objects;
|
using osu.Game.Rulesets.Taiko.Objects;
|
||||||
using osu.Game.Tests.Visual;
|
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Taiko.Tests
|
namespace osu.Game.Rulesets.Taiko.Tests
|
||||||
{
|
{
|
||||||
public class TestSceneSwellJudgements : PlayerTestScene
|
public class TestSceneSwellJudgements : TestSceneTaikoPlayer
|
||||||
{
|
{
|
||||||
public TestSceneSwellJudgements()
|
|
||||||
: base(new TaikoRuleset())
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void TestZeroTickTimeOffsets()
|
public void TestZeroTickTimeOffsets()
|
||||||
{
|
{
|
||||||
|
19
osu.Game.Rulesets.Taiko.Tests/TestSceneTaikoPlayer.cs
Normal file
19
osu.Game.Rulesets.Taiko.Tests/TestSceneTaikoPlayer.cs
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
// 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 System.Collections.Generic;
|
||||||
|
using osu.Game.Tests.Visual;
|
||||||
|
|
||||||
|
namespace osu.Game.Rulesets.Taiko.Tests
|
||||||
|
{
|
||||||
|
public class TestSceneTaikoPlayer : PlayerTestScene
|
||||||
|
{
|
||||||
|
public override IReadOnlyList<Type> RequiredTypes => new[]
|
||||||
|
{
|
||||||
|
typeof(TaikoRuleset)
|
||||||
|
};
|
||||||
|
|
||||||
|
protected override Ruleset CreateRuleset() => new TaikoRuleset();
|
||||||
|
}
|
||||||
|
}
|
@ -11,13 +11,8 @@ using osu.Game.Tests.Visual;
|
|||||||
|
|
||||||
namespace osu.Game.Rulesets.Taiko.Tests
|
namespace osu.Game.Rulesets.Taiko.Tests
|
||||||
{
|
{
|
||||||
public class TestSceneTaikoSuddenDeath : PlayerTestScene
|
public class TestSceneTaikoSuddenDeath : TestSceneTaikoPlayer
|
||||||
{
|
{
|
||||||
public TestSceneTaikoSuddenDeath()
|
|
||||||
: base(new TaikoRuleset())
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override bool AllowFail => true;
|
protected override bool AllowFail => true;
|
||||||
|
|
||||||
protected override TestPlayer CreatePlayer(Ruleset ruleset)
|
protected override TestPlayer CreatePlayer(Ruleset ruleset)
|
||||||
|
@ -16,17 +16,16 @@ using osu.Game.Beatmaps;
|
|||||||
using osu.Game.Beatmaps.Formats;
|
using osu.Game.Beatmaps.Formats;
|
||||||
using osu.Game.IO;
|
using osu.Game.IO;
|
||||||
using osu.Game.Rulesets;
|
using osu.Game.Rulesets;
|
||||||
using osu.Game.Rulesets.Osu;
|
|
||||||
using osu.Game.Skinning;
|
using osu.Game.Skinning;
|
||||||
using osu.Game.Storyboards;
|
using osu.Game.Storyboards;
|
||||||
using osu.Game.Tests.Resources;
|
using osu.Game.Tests.Resources;
|
||||||
using osu.Game.Tests.Visual;
|
using osu.Game.Tests.Visual.Gameplay;
|
||||||
using osu.Game.Users;
|
using osu.Game.Users;
|
||||||
|
|
||||||
namespace osu.Game.Tests.Gameplay
|
namespace osu.Game.Tests.Gameplay
|
||||||
{
|
{
|
||||||
[HeadlessTest]
|
[HeadlessTest]
|
||||||
public class TestSceneHitObjectSamples : PlayerTestScene
|
public class TestSceneHitObjectSamples : TestPlayerTestScene
|
||||||
{
|
{
|
||||||
private readonly SkinInfo userSkinInfo = new SkinInfo();
|
private readonly SkinInfo userSkinInfo = new SkinInfo();
|
||||||
|
|
||||||
@ -44,11 +43,6 @@ namespace osu.Game.Tests.Gameplay
|
|||||||
|
|
||||||
protected override bool HasCustomSteps => true;
|
protected override bool HasCustomSteps => true;
|
||||||
|
|
||||||
public TestSceneHitObjectSamples()
|
|
||||||
: base(new OsuRuleset())
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
private SkinSourceDependencyContainer dependencies;
|
private SkinSourceDependencyContainer dependencies;
|
||||||
|
|
||||||
protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnlyDependencyContainer parent)
|
protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnlyDependencyContainer parent)
|
||||||
|
16
osu.Game.Tests/Visual/Gameplay/TestPlayerTestScene.cs
Normal file
16
osu.Game.Tests/Visual/Gameplay/TestPlayerTestScene.cs
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
// 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 osu.Game.Rulesets;
|
||||||
|
using osu.Game.Rulesets.Osu;
|
||||||
|
|
||||||
|
namespace osu.Game.Tests.Visual.Gameplay
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// A <see cref="PlayerTestScene"/> with an arbitrary ruleset value to test with.
|
||||||
|
/// </summary>
|
||||||
|
public abstract class TestPlayerTestScene : PlayerTestScene
|
||||||
|
{
|
||||||
|
protected override Ruleset CreateRuleset() => new OsuRuleset();
|
||||||
|
}
|
||||||
|
}
|
@ -10,23 +10,17 @@ using osu.Framework.Utils;
|
|||||||
using osu.Framework.Timing;
|
using osu.Framework.Timing;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Rulesets;
|
using osu.Game.Rulesets;
|
||||||
using osu.Game.Rulesets.Osu;
|
|
||||||
using osu.Game.Rulesets.Osu.Objects;
|
using osu.Game.Rulesets.Osu.Objects;
|
||||||
using osu.Game.Storyboards;
|
using osu.Game.Storyboards;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
|
|
||||||
namespace osu.Game.Tests.Visual.Gameplay
|
namespace osu.Game.Tests.Visual.Gameplay
|
||||||
{
|
{
|
||||||
public class TestSceneGameplayRewinding : PlayerTestScene
|
public class TestSceneGameplayRewinding : TestPlayerTestScene
|
||||||
{
|
{
|
||||||
[Resolved]
|
[Resolved]
|
||||||
private AudioManager audioManager { get; set; }
|
private AudioManager audioManager { get; set; }
|
||||||
|
|
||||||
public TestSceneGameplayRewinding()
|
|
||||||
: base(new OsuRuleset())
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
private Track track;
|
private Track track;
|
||||||
|
|
||||||
protected override WorkingBeatmap CreateWorkingBeatmap(IBeatmap beatmap, Storyboard storyboard = null)
|
protected override WorkingBeatmap CreateWorkingBeatmap(IBeatmap beatmap, Storyboard storyboard = null)
|
||||||
|
@ -10,14 +10,13 @@ using osu.Framework.Testing;
|
|||||||
using osu.Game.Graphics.Containers;
|
using osu.Game.Graphics.Containers;
|
||||||
using osu.Game.Graphics.Cursor;
|
using osu.Game.Graphics.Cursor;
|
||||||
using osu.Game.Rulesets;
|
using osu.Game.Rulesets;
|
||||||
using osu.Game.Rulesets.Osu;
|
|
||||||
using osu.Game.Screens.Play;
|
using osu.Game.Screens.Play;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
using osuTK.Input;
|
using osuTK.Input;
|
||||||
|
|
||||||
namespace osu.Game.Tests.Visual.Gameplay
|
namespace osu.Game.Tests.Visual.Gameplay
|
||||||
{
|
{
|
||||||
public class TestScenePause : PlayerTestScene
|
public class TestScenePause : TestPlayerTestScene
|
||||||
{
|
{
|
||||||
protected new PausePlayer Player => (PausePlayer)base.Player;
|
protected new PausePlayer Player => (PausePlayer)base.Player;
|
||||||
|
|
||||||
@ -26,7 +25,6 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
protected override Container<Drawable> Content => content;
|
protected override Container<Drawable> Content => content;
|
||||||
|
|
||||||
public TestScenePause()
|
public TestScenePause()
|
||||||
: base(new OsuRuleset())
|
|
||||||
{
|
{
|
||||||
base.Content.Add(content = new MenuCursorContainer { RelativeSizeAxes = Axes.Both });
|
base.Content.Add(content = new MenuCursorContainer { RelativeSizeAxes = Axes.Both });
|
||||||
}
|
}
|
||||||
|
@ -8,12 +8,11 @@ using osu.Framework.Platform;
|
|||||||
using osu.Framework.Testing;
|
using osu.Framework.Testing;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Rulesets;
|
using osu.Game.Rulesets;
|
||||||
using osu.Game.Rulesets.Osu;
|
|
||||||
|
|
||||||
namespace osu.Game.Tests.Visual.Gameplay
|
namespace osu.Game.Tests.Visual.Gameplay
|
||||||
{
|
{
|
||||||
[HeadlessTest] // we alter unsafe properties on the game host to test inactive window state.
|
[HeadlessTest] // we alter unsafe properties on the game host to test inactive window state.
|
||||||
public class TestScenePauseWhenInactive : PlayerTestScene
|
public class TestScenePauseWhenInactive : TestPlayerTestScene
|
||||||
{
|
{
|
||||||
protected override IBeatmap CreateBeatmap(RulesetInfo ruleset)
|
protected override IBeatmap CreateBeatmap(RulesetInfo ruleset)
|
||||||
{
|
{
|
||||||
@ -27,11 +26,6 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
[Resolved]
|
[Resolved]
|
||||||
private GameHost host { get; set; }
|
private GameHost host { get; set; }
|
||||||
|
|
||||||
public TestScenePauseWhenInactive()
|
|
||||||
: base(new OsuRuleset())
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void TestDoesntPauseDuringIntro()
|
public void TestDoesntPauseDuringIntro()
|
||||||
{
|
{
|
||||||
|
@ -19,15 +19,8 @@ namespace osu.Game.Tests.Visual
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
protected virtual bool HasCustomSteps { get; } = false;
|
protected virtual bool HasCustomSteps { get; } = false;
|
||||||
|
|
||||||
private readonly Ruleset ruleset;
|
|
||||||
|
|
||||||
protected TestPlayer Player;
|
protected TestPlayer Player;
|
||||||
|
|
||||||
protected PlayerTestScene(Ruleset ruleset)
|
|
||||||
{
|
|
||||||
this.ruleset = ruleset;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected OsuConfigManager LocalConfig;
|
protected OsuConfigManager LocalConfig;
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
@ -53,7 +46,7 @@ namespace osu.Game.Tests.Visual
|
|||||||
|
|
||||||
action?.Invoke();
|
action?.Invoke();
|
||||||
|
|
||||||
AddStep(ruleset.RulesetInfo.Name, LoadPlayer);
|
AddStep(CreateRuleset().RulesetInfo.Name, LoadPlayer);
|
||||||
AddUntilStep("player loaded", () => Player.IsLoaded && Player.Alpha == 1);
|
AddUntilStep("player loaded", () => Player.IsLoaded && Player.Alpha == 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -63,28 +56,28 @@ namespace osu.Game.Tests.Visual
|
|||||||
|
|
||||||
protected void LoadPlayer()
|
protected void LoadPlayer()
|
||||||
{
|
{
|
||||||
var beatmap = CreateBeatmap(ruleset.RulesetInfo);
|
var beatmap = CreateBeatmap(Ruleset.Value);
|
||||||
|
|
||||||
Beatmap.Value = CreateWorkingBeatmap(beatmap);
|
Beatmap.Value = CreateWorkingBeatmap(beatmap);
|
||||||
Ruleset.Value = ruleset.RulesetInfo;
|
|
||||||
|
|
||||||
SelectedMods.Value = Array.Empty<Mod>();
|
SelectedMods.Value = Array.Empty<Mod>();
|
||||||
|
|
||||||
|
var rulesetInstance = Ruleset.Value.CreateInstance();
|
||||||
|
|
||||||
if (!AllowFail)
|
if (!AllowFail)
|
||||||
{
|
{
|
||||||
var noFailMod = ruleset.GetAllMods().FirstOrDefault(m => m is ModNoFail);
|
var noFailMod = rulesetInstance.GetAllMods().FirstOrDefault(m => m is ModNoFail);
|
||||||
if (noFailMod != null)
|
if (noFailMod != null)
|
||||||
SelectedMods.Value = new[] { noFailMod };
|
SelectedMods.Value = new[] { noFailMod };
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Autoplay)
|
if (Autoplay)
|
||||||
{
|
{
|
||||||
var mod = ruleset.GetAutoplayMod();
|
var mod = rulesetInstance.GetAutoplayMod();
|
||||||
if (mod != null)
|
if (mod != null)
|
||||||
SelectedMods.Value = SelectedMods.Value.Concat(mod.Yield()).ToArray();
|
SelectedMods.Value = SelectedMods.Value.Concat(mod.Yield()).ToArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
Player = CreatePlayer(ruleset);
|
Player = CreatePlayer(rulesetInstance);
|
||||||
LoadScreen(Player);
|
LoadScreen(Player);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user