2019-01-24 08:43:03 +00:00
|
|
|
|
// 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.
|
2018-06-07 11:24:33 +00:00
|
|
|
|
|
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
|
using osu.Framework.Graphics.Containers;
|
|
|
|
|
using osu.Framework.Input.Bindings;
|
|
|
|
|
using osu.Game.Tests.Visual;
|
|
|
|
|
|
|
|
|
|
namespace osu.Game.Rulesets.Mania.Tests
|
|
|
|
|
{
|
2019-05-14 19:37:25 +00:00
|
|
|
|
public abstract class ManiaInputTestScene : OsuTestScene
|
2018-06-07 11:24:33 +00:00
|
|
|
|
{
|
|
|
|
|
private readonly Container<Drawable> content;
|
|
|
|
|
protected override Container<Drawable> Content => content ?? base.Content;
|
|
|
|
|
|
2019-05-14 19:37:25 +00:00
|
|
|
|
protected ManiaInputTestScene(int keys)
|
2018-06-07 11:24:33 +00:00
|
|
|
|
{
|
|
|
|
|
base.Content.Add(content = new LocalInputManager(keys));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private class LocalInputManager : ManiaInputManager
|
|
|
|
|
{
|
|
|
|
|
public LocalInputManager(int variant)
|
|
|
|
|
: base(new ManiaRuleset().RulesetInfo, variant)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override RulesetKeyBindingContainer CreateKeyBindingContainer(RulesetInfo ruleset, int variant, SimultaneousBindingMode unique)
|
|
|
|
|
=> new LocalKeyBindingContainer(ruleset, variant, unique);
|
|
|
|
|
|
|
|
|
|
private class LocalKeyBindingContainer : RulesetKeyBindingContainer
|
|
|
|
|
{
|
|
|
|
|
public LocalKeyBindingContainer(RulesetInfo ruleset, int variant, SimultaneousBindingMode unique)
|
|
|
|
|
: base(ruleset, variant, unique)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void ReloadMappings()
|
|
|
|
|
{
|
|
|
|
|
KeyBindings = DefaultKeyBindings;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|