mirror of
https://github.com/ppy/osu.git
synced 2025-01-13 16:32:54 +08:00
Remove IRulesetTestScene and use OsuTestScene.CreateRuleset() instead
This commit is contained in:
parent
97340da2f2
commit
60381d5817
@ -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();
|
||||
}
|
||||
}
|
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user