From 60381d581718dad2d92dfef6b0da3ff8026fa9fe Mon Sep 17 00:00:00 2001 From: Salman Ahmed Date: Fri, 17 Apr 2020 03:38:12 +0300 Subject: [PATCH] Remove IRulesetTestScene and use OsuTestScene.CreateRuleset() instead --- .../Rulesets/Testing/IRulesetTestScene.cs | 20 ------------------- osu.Game/Tests/Visual/OsuTestScene.cs | 6 +++--- 2 files changed, 3 insertions(+), 23 deletions(-) delete mode 100644 osu.Game/Rulesets/Testing/IRulesetTestScene.cs diff --git a/osu.Game/Rulesets/Testing/IRulesetTestScene.cs b/osu.Game/Rulesets/Testing/IRulesetTestScene.cs deleted file mode 100644 index e8b8a79eb5..0000000000 --- a/osu.Game/Rulesets/Testing/IRulesetTestScene.cs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. -// See the LICENCE file in the repository root for full licence text. - -namespace osu.Game.Rulesets.Testing -{ - /// - /// 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. - /// - public interface IRulesetTestScene - { - /// - /// Retrieves the ruleset that is going - /// to be tested by this test scene. - /// - /// The . - Ruleset CreateRuleset(); - } -} diff --git a/osu.Game/Tests/Visual/OsuTestScene.cs b/osu.Game/Tests/Visual/OsuTestScene.cs index eb1905cbe1..82ba989306 100644 --- a/osu.Game/Tests/Visual/OsuTestScene.cs +++ b/osu.Game/Tests/Visual/OsuTestScene.cs @@ -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);