osukey/osu.Game/Tests/Visual/LegacySkinPlayerTestScene.cs
Salman Ahmed e7d2f42149 Revert "Merge branch 'fix-legacy-skin-test' into catch-hide-combo-workaround"
This reverts commit 380d004683ad658d9ecbc408f7844eaa4c2b43c8, reversing
changes made to ff419af5128a3e0f2d188e10fcb05aed712ac128.
2021-05-18 17:46:15 +03:00

40 lines
1.2 KiB
C#

// 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 NUnit.Framework;
using osu.Framework.Allocation;
using osu.Framework.IO.Stores;
using osu.Game.Rulesets;
using osu.Game.Skinning;
namespace osu.Game.Tests.Visual
{
[TestFixture]
public abstract class LegacySkinPlayerTestScene : PlayerTestScene
{
protected LegacySkin LegacySkin { get; private set; }
private ISkinSource legacySkinSource;
protected override TestPlayer CreatePlayer(Ruleset ruleset) => new SkinProvidingPlayer(legacySkinSource);
[BackgroundDependencyLoader]
private void load(OsuGameBase game, SkinManager skins)
{
LegacySkin = new DefaultLegacySkin(new NamespacedResourceStore<byte[]>(game.Resources, "Skins/Legacy"), skins);
legacySkinSource = new SkinProvidingContainer(LegacySkin);
}
public class SkinProvidingPlayer : TestPlayer
{
[Cached(typeof(ISkinSource))]
private readonly ISkinSource skinSource;
public SkinProvidingPlayer(ISkinSource skinSource)
{
this.skinSource = skinSource;
}
}
}
}