using Microsoft.Xna.Framework.Input;

namespace Igdc.Controls
{
    public abstract class KeyboardConfigBase : ControlConfigBase<Keys>
    {
        private KeyboardState _state;

        public override ControlState ExitButton => ProcessButton(Keys.Escape);

        public override ControlState FullscreenButton => ProcessButton(Keys.F11);

        public override ControlState RestartButton => ProcessButton(Keys.F5);

        protected override bool CheckButton(Keys button) => _state.IsKeyDown(button);

        public override void Refresh()
        {
            _state = Keyboard.GetState();
            base.Refresh();
        }
    }
}