namespace MoonWorks.Input { public abstract class VirtualButton { public ButtonState State { get; protected set; } /// /// True if the button is pressed or held. /// public bool IsDown => State.IsDown; /// /// True if the button has been continuously held for more than one frame. /// public bool IsHeld => State.IsHeld; /// /// True if the button was pressed this exact frame. /// public bool IsPressed => State.IsPressed; /// /// True if the button is not pressed. /// public bool IsReleased => State.IsReleased; internal virtual void Update() { State = State.Update(CheckPressed()); } internal abstract bool CheckPressed(); } }