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:
parent
611f64fd36
commit
11da045d8c
@ -16,7 +16,6 @@ namespace osu.Game.Rulesets.Catch.Tests
|
||||
[TestFixture]
|
||||
public class TestSceneHyperDash : TestSceneCatchPlayer
|
||||
{
|
||||
|
||||
protected override bool Autoplay => true;
|
||||
|
||||
[Test]
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user