using Microsoft.Xna.Framework.Input;

namespace Igdc.Controls
{
    public class KeyboardConfigSingleplayer : KeyboardConfigBase
    {
        public override ControlState BattleLeftButton => ProcessButton(Keys.OemComma, Keys.Left);

        public override ControlState BattleRightButton => ProcessButton(Keys.OemQuestion, Keys.Right);

        public override ControlState MoveLeftButton => ProcessButton(Keys.A, Keys.Left);

        public override ControlState MoveUpButton => ProcessButton(Keys.W, Keys.Up);

        public override ControlState MoveRightButton => ProcessButton(Keys.D, Keys.Right);

        public override ControlState MoveDownButton => ProcessButton(Keys.S, Keys.Down);

        public override ControlState MagicButton => ProcessButton(Keys.OemPeriod, Keys.Up, Keys.Down);

        public override ControlState UiNextButton => ProcessButton(Keys.Down, Keys.Right);

        public override ControlState UiPrevButton => ProcessButton(Keys.Up, Keys.Left);

        public override ControlState UiAcceptButton => ProcessButton(Keys.Enter, Keys.Space);

        protected override ControlState GetFieldCell(int x, int y)
        {
            if (x == 0 && y == 0) return ProcessButton(Keys.Q);
            if (x == 1 && y == 0) return ProcessButton(Keys.W);
            if (x == 2 && y == 0) return ProcessButton(Keys.E);
            if (x == 0 && y == 1) return ProcessButton(Keys.A);
            if (x == 1 && y == 1) return ProcessButton(Keys.S);
            if (x == 2 && y == 1) return ProcessButton(Keys.D);
            return ControlState.None;
        }
    }
}