1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-17 07:12:55 +08:00
osu-lazer/osu.Game.Tests/Visual/Gameplay/SkinnableHUDComponentTestScene.cs

43 lines
1.4 KiB
C#
Raw Normal View History

// 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 osu.Framework.Graphics;
using osu.Framework.Testing;
using osu.Game.Rulesets;
using osu.Game.Rulesets.Osu;
using osu.Game.Skinning;
namespace osu.Game.Tests.Visual.Gameplay
{
2022-11-24 13:32:20 +08:00
public abstract partial class SkinnableHUDComponentTestScene : SkinnableTestScene
{
protected override Ruleset CreateRulesetForSkinProvider() => new OsuRuleset();
[SetUpSteps]
public virtual void SetUpSteps()
{
AddStep("setup components", SetUpComponents);
}
public void SetUpComponents()
{
SetContents(skin =>
{
var implementation = skin is LegacySkin
? CreateLegacyImplementation()
: skin is ArgonSkin
? CreateArgonImplementation()
: CreateDefaultImplementation();
implementation.Anchor = Anchor.Centre;
implementation.Origin = Anchor.Centre;
return implementation;
});
}
protected abstract Drawable CreateDefaultImplementation();
protected virtual Drawable CreateArgonImplementation() => CreateDefaultImplementation();
protected abstract Drawable CreateLegacyImplementation();
}
}