Use IBindable<>

This commit is contained in:
Dean Herbert 2018-11-26 17:07:30 +09:00
parent 266873740d
commit 32b36f2883
2 changed files with 5 additions and 3 deletions

View File

@ -23,7 +23,9 @@ public class IdleTracker : Component, IKeyBindingHandler<PlatformAction>, IHandl
/// <summary> /// <summary>
/// Whether the user is currently in an idle state. /// Whether the user is currently in an idle state.
/// </summary> /// </summary>
public BindableBool IsIdle = new BindableBool(); public IBindable<bool> IsIdle => isIdle;
private readonly BindableBool isIdle = new BindableBool();
/// <summary> /// <summary>
/// Intstantiate a new <see cref="IdleTracker"/>. /// Intstantiate a new <see cref="IdleTracker"/>.
@ -38,7 +40,7 @@ public IdleTracker(double timeToIdle)
protected override void Update() protected override void Update()
{ {
base.Update(); base.Update();
IsIdle.Value = TimeSpentIdle > timeToIdle; isIdle.Value = TimeSpentIdle > timeToIdle;
} }
public bool OnPressed(PlatformAction action) => updateLastInteractionTime(); public bool OnPressed(PlatformAction action) => updateLastInteractionTime();

View File

@ -28,7 +28,7 @@ public class ButtonSystem : Container, IStateful<ButtonSystemState>, IKeyBinding
{ {
public event Action<ButtonSystemState> StateChanged; public event Action<ButtonSystemState> StateChanged;
private readonly BindableBool isIdle = new BindableBool(); private readonly IBindable<bool> isIdle = new BindableBool();
public Action OnEdit; public Action OnEdit;
public Action OnExit; public Action OnExit;