1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-13 13:32:54 +08:00

Remove IRulesetTestScene and use OsuTestScene.CreateRuleset() instead

This commit is contained in:
Salman Ahmed 2020-04-17 03:38:12 +03:00
parent 97340da2f2
commit 60381d5817
No known key found for this signature in database
GPG Key ID: ED81FD33FD9B58BC
2 changed files with 3 additions and 23 deletions

View File

@ -1,20 +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.
namespace osu.Game.Rulesets.Testing
{
/// <summary>
/// An interface that can be assigned to test scenes to indicate
/// that the test scene is testing ruleset-specific components.
/// This is to cache required ruleset dependencies for the components.
/// </summary>
public interface IRulesetTestScene
{
/// <summary>
/// Retrieves the ruleset that is going
/// to be tested by this test scene.
/// </summary>
/// <returns>The <see cref="Ruleset"/>.</returns>
Ruleset CreateRuleset();
}
}

View File

@ -20,7 +20,6 @@ using osu.Game.Database;
using osu.Game.Online.API;
using osu.Game.Rulesets;
using osu.Game.Rulesets.Mods;
using osu.Game.Rulesets.Testing;
using osu.Game.Rulesets.UI;
using osu.Game.Screens;
using osu.Game.Storyboards;
@ -70,8 +69,9 @@ namespace osu.Game.Tests.Visual
{
var baseDependencies = base.CreateChildDependencies(parent);
if (this is IRulesetTestScene rts)
baseDependencies = rulesetDependencies = new DrawableRulesetDependencies(rts.CreateRuleset(), baseDependencies);
var providedRuleset = CreateRuleset();
if (providedRuleset != null)
baseDependencies = rulesetDependencies = new DrawableRulesetDependencies(providedRuleset, baseDependencies);
Dependencies = new OsuScreenDependencies(false, baseDependencies);