Scope and limit parameter to IBeatmapSkin

This commit is contained in:
Craftplacer 2020-08-29 14:47:26 +02:00
parent 9ce9ba3a0d
commit 43e91877a7
1 changed files with 6 additions and 9 deletions

View File

@ -29,7 +29,7 @@ namespace osu.Game.Rulesets.Osu.Tests
public class TestSceneSkinFallbacks : TestSceneOsuPlayer
{
private readonly TestSource testUserSkin;
private readonly TestSource testBeatmapSkin;
private readonly BeatmapTestSource testBeatmapSkin;
public TestSceneSkinFallbacks()
{
@ -80,18 +80,15 @@ private void checkNextHitObject(string skin) =>
public class CustomSkinWorkingBeatmap : ClockBackedTestWorkingBeatmap
{
private readonly ISkinSource skinSource;
private readonly IBeatmapSkin skin;
public CustomSkinWorkingBeatmap(IBeatmap beatmap, Storyboard storyboard, IFrameBasedClock frameBasedClock, AudioManager audio, ISkinSource skin)
public CustomSkinWorkingBeatmap(IBeatmap beatmap, Storyboard storyboard, IFrameBasedClock frameBasedClock, AudioManager audio, IBeatmapSkin skin)
: base(beatmap, storyboard, frameBasedClock, audio)
{
if (!(skin is IBeatmapSkin))
throw new ArgumentException("The provided skin source must be of type IBeatmapSkin.");
skinSource = skin;
this.skin = skin;
}
protected override IBeatmapSkin GetSkin() => (IBeatmapSkin)skinSource;
protected override IBeatmapSkin GetSkin() => skin;
}
public class SkinProvidingPlayer : TestPlayer
@ -115,7 +112,7 @@ protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnl
}
}
public class BeatmapTestSource : TestSource, IBeatmapSkin
private class BeatmapTestSource : TestSource, IBeatmapSkin
{
public BeatmapTestSource()
: base("beatmap")