Add documentation and regions to RulesetInputManager

This commit is contained in:
Dean Herbert 2017-08-24 15:48:40 +09:00
parent a7a7e0323f
commit f0635af40d
1 changed files with 35 additions and 8 deletions

View File

@ -23,6 +23,8 @@ protected RulesetInputManager(RulesetInfo ruleset, int variant, SimultaneousBind
{
}
#region Action mapping (for replays)
private List<T> lastPressedActions = new List<T>();
protected override void HandleNewState(InputState state)
@ -47,8 +49,9 @@ protected override void HandleNewState(InputState state)
lastPressedActions = newActions;
}
private ManualClock clock;
private IFrameBasedClock parentClock;
#endregion
#region IHasReplayHandler
private ReplayInputHandler replayInputHandler;
public ReplayInputHandler ReplayInputHandler
@ -69,13 +72,12 @@ public ReplayInputHandler ReplayInputHandler
}
}
private Bindable<bool> mouseDisabled;
#endregion
[BackgroundDependencyLoader]
private void load(OsuConfigManager config)
{
mouseDisabled = config.GetBindable<bool>(OsuSetting.MouseDisableButtons);
}
#region Clock control
private ManualClock clock;
private IFrameBasedClock parentClock;
protected override void LoadComplete()
{
@ -152,6 +154,18 @@ protected override void Update()
base.Update();
}
#endregion
#region Setting application (disables etc.)
private Bindable<bool> mouseDisabled;
[BackgroundDependencyLoader]
private void load(OsuConfigManager config)
{
mouseDisabled = config.GetBindable<bool>(OsuSetting.MouseDisableButtons);
}
protected override void TransformState(InputState state)
{
base.TransformState(state);
@ -171,6 +185,10 @@ protected override void TransformState(InputState state)
}
}
#endregion
#region Key Counter Attachment
public void Attach(KeyCounterCollection keyCounter)
{
var receptor = new ActionReceptor(keyCounter);
@ -191,13 +209,22 @@ public ActionReceptor(KeyCounterCollection target)
public bool OnReleased(T action) => Target.Children.OfType<KeyCounterAction<T>>().Any(c => c.OnReleased(action));
}
#endregion
}
/// <summary>
/// Expose the <see cref="ReplayInputHandler"/> in a capable <see cref="InputManager"/>.
/// </summary>
public interface IHasReplayHandler
{
ReplayInputHandler ReplayInputHandler { get; set; }
}
/// <summary>
/// Supports attaching a <see cref="KeyCounterCollection"/>.
/// Keys will be populated automatically and a receptor will be injected inside.
/// </summary>
public interface ICanAttachKeyCounter
{
void Attach(KeyCounterCollection keyCounter);