mirror of
https://github.com/osukey/osukey.git
synced 2025-08-03 22:56:36 +09:00
Generalize legacy skin player test.
This commit is contained in:
@ -2,39 +2,13 @@
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using NUnit.Framework;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Audio;
|
||||
using osu.Framework.IO.Stores;
|
||||
using osu.Game.Skinning;
|
||||
using osu.Game.Tests.Visual;
|
||||
|
||||
namespace osu.Game.Rulesets.Catch.Tests
|
||||
{
|
||||
[TestFixture]
|
||||
public class TestSceneCatchPlayerLegacySkin : PlayerTestScene
|
||||
public class TestSceneCatchPlayerLegacySkin : LegacySkinPlayerTestScene
|
||||
{
|
||||
private ISkinSource legacySkinSource;
|
||||
|
||||
protected override TestPlayer CreatePlayer(Ruleset ruleset) => new SkinProvidingPlayer(legacySkinSource);
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(AudioManager audio, OsuGameBase game)
|
||||
{
|
||||
var legacySkin = new DefaultLegacySkin(new NamespacedResourceStore<byte[]>(game.Resources, "Skins/Legacy"), audio);
|
||||
legacySkinSource = new SkinProvidingContainer(legacySkin);
|
||||
}
|
||||
|
||||
protected override Ruleset CreatePlayerRuleset() => new CatchRuleset();
|
||||
|
||||
public class SkinProvidingPlayer : TestPlayer
|
||||
{
|
||||
[Cached(typeof(ISkinSource))]
|
||||
private readonly ISkinSource skinSource;
|
||||
|
||||
public SkinProvidingPlayer(ISkinSource skinSource)
|
||||
{
|
||||
this.skinSource = skinSource;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user