1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-17 19:06:27 +08:00
osu-lazer/osu.Game/Tests/Visual/ManualInputManagerTestCase.cs
Dean Herbert 768a5e5383 Create ManualInputManagerTestCase
A base class for running more input-driven tests.
2018-04-06 15:23:30 +09:00

30 lines
942 B
C#

// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Testing.Input;
namespace osu.Game.Tests.Visual
{
public abstract class ManualInputManagerTestCase : OsuTestCase
{
protected override Container<Drawable> Content => InputManager;
protected readonly ManualInputManager InputManager;
protected ManualInputManagerTestCase()
{
base.Content.Add(InputManager = new ManualInputManager());
ReturnUserInput();
}
/// <summary>
/// Returns input back to the user.
/// </summary>
protected void ReturnUserInput()
{
AddStep("Return user input", () => InputManager.UseParentState = true);
}
}
}