1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 11:37:28 +08:00

Split out interfaces from RulesetInputManager and improve xmldoc

This commit is contained in:
Dean Herbert 2023-06-26 16:34:57 +09:00
parent c8e081c2b6
commit 084354a8dc
4 changed files with 52 additions and 23 deletions

View File

@ -0,0 +1,21 @@
// 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.Game.Screens.Play.HUD;
using osu.Game.Screens.Play.HUD.ClicksPerSecond;
namespace osu.Game.Rulesets.UI
{
/// <summary>
/// A target (generally always <see cref="DrawableRuleset"/>) which can attach various skinnable components.
/// </summary>
/// <remarks>
/// Attach methods will give the target permission to prepare the component into a usable state, usually via
/// calling methods on the component (attaching various gameplay devices).
/// </remarks>
public interface ICanAttachHUDPieces
{
void Attach(KeyCounterController keyCounter);
void Attach(ClicksPerSecondCalculator calculator);
}
}

View File

@ -0,0 +1,15 @@
// 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.Input;
namespace osu.Game.Rulesets.UI
{
/// <summary>
/// Expose the <see cref="ReplayRecorder"/> in a capable <see cref="InputManager"/>.
/// </summary>
public interface IHasRecordingHandler
{
public ReplayRecorder Recorder { set; }
}
}

View File

@ -0,0 +1,16 @@
// 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.Input;
using osu.Game.Input.Handlers;
namespace osu.Game.Rulesets.UI
{
/// <summary>
/// Expose the <see cref="ReplayInputHandler"/> in a capable <see cref="InputManager"/>.
/// </summary>
public interface IHasReplayHandler
{
ReplayInputHandler? ReplayInputHandler { get; set; }
}
}

View File

@ -225,29 +225,6 @@ namespace osu.Game.Rulesets.UI
}
}
/// <summary>
/// Expose the <see cref="ReplayInputHandler"/> in a capable <see cref="InputManager"/>.
/// </summary>
public interface IHasReplayHandler
{
ReplayInputHandler ReplayInputHandler { get; set; }
}
public interface IHasRecordingHandler
{
public ReplayRecorder Recorder { set; }
}
/// <summary>
/// Supports attaching various HUD pieces.
/// Keys will be populated automatically and a receptor will be injected inside.
/// </summary>
public interface ICanAttachHUDPieces
{
void Attach(KeyCounterController keyCounter);
void Attach(ClicksPerSecondCalculator calculator);
}
public class RulesetInputManagerInputState<T> : InputState
where T : struct
{