1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-12 19:42:55 +08:00

Reorder declaration position of ruleset-creation methods

Should be recognized as a normal protected method in its declaring class.
This commit is contained in:
Salman Ahmed 2020-06-03 23:43:18 +03:00
parent 611f64fd36
commit 11da045d8c
No known key found for this signature in database
GPG Key ID: ED81FD33FD9B58BC
3 changed files with 22 additions and 19 deletions

View File

@ -16,7 +16,6 @@ namespace osu.Game.Rulesets.Catch.Tests
[TestFixture]
public class TestSceneHyperDash : TestSceneCatchPlayer
{
protected override bool Autoplay => true;
[Test]

View File

@ -24,15 +24,6 @@ namespace osu.Game.Tests.Visual
protected OsuConfigManager LocalConfig;
/// <summary>
/// Creates the ruleset for setting up the <see cref="Player"/> component.
/// </summary>
[NotNull]
protected abstract Ruleset CreatePlayerRuleset();
protected sealed override Ruleset CreateRuleset() => CreatePlayerRuleset();
[NotNull]
private readonly Ruleset ruleset;
protected PlayerTestScene()
@ -97,6 +88,14 @@ namespace osu.Game.Tests.Visual
LoadScreen(Player);
}
/// <summary>
/// Creates the ruleset for setting up the <see cref="Player"/> component.
/// </summary>
[NotNull]
protected abstract Ruleset CreatePlayerRuleset();
protected sealed override Ruleset CreateRuleset() => CreatePlayerRuleset();
protected virtual TestPlayer CreatePlayer(Ruleset ruleset) => new TestPlayer(false, false);
}
}

View File

@ -23,27 +23,24 @@ namespace osu.Game.Tests.Visual
{
public abstract class SkinnableTestScene : OsuGridTestScene
{
private readonly Ruleset ruleset;
private Skin metricsSkin;
private Skin defaultSkin;
private Skin specialSkin;
private Skin oldSkin;
/// <summary>
/// Creates the ruleset for adding the ruleset-specific skin transforming component.
/// </summary>
[NotNull]
protected abstract Ruleset CreateRulesetForSkinProvider();
protected sealed override Ruleset CreateRuleset() => CreateRulesetForSkinProvider();
protected SkinnableTestScene()
: base(2, 3)
{
ruleset = CreateRulesetForSkinProvider();
}
[BackgroundDependencyLoader]
private void load(AudioManager audio, SkinManager skinManager)
{
Ruleset.Value = ruleset.RulesetInfo;
var dllStore = new DllResourceStore(DynamicCompilationOriginal.GetType().Assembly);
metricsSkin = new TestLegacySkin(new SkinInfo { Name = "metrics-skin" }, new NamespacedResourceStore<byte[]>(dllStore, "Resources/metrics_skin"), audio, true);
@ -113,7 +110,7 @@ namespace osu.Game.Tests.Visual
{
new OutlineBox { Alpha = autoSize ? 1 : 0 },
mainProvider.WithChild(
new SkinProvidingContainer(CreateRulesetForSkinProvider().CreateLegacySkinProvider(mainProvider, beatmap))
new SkinProvidingContainer(ruleset.CreateLegacySkinProvider(mainProvider, beatmap))
{
Child = created,
RelativeSizeAxes = !autoSize ? Axes.Both : Axes.None,
@ -126,6 +123,14 @@ namespace osu.Game.Tests.Visual
};
}
/// <summary>
/// Creates the ruleset for adding the corresponding skin transforming component.
/// </summary>
[NotNull]
protected abstract Ruleset CreateRulesetForSkinProvider();
protected sealed override Ruleset CreateRuleset() => CreateRulesetForSkinProvider();
protected virtual IBeatmap CreateBeatmapForSkinProvider() => CreateWorkingBeatmap(Ruleset.Value).GetPlayableBeatmap(Ruleset.Value);
private class OutlineBox : CompositeDrawable