示例#1
0
        public ButtonInputSet(ButtonInput input)
        {
            if (input == null)
            {
                throw new ArgumentNullException(nameof(input));
            }

            Inputs = new List <ButtonInput> {
                input
            };
        }
示例#2
0
        public bool RemoveButtonInput(string inputName, ButtonInput button)
        {
            if (!buttons.ContainsKey(inputName))
            {
                return(false);
            }

            ButtonInputSet buttonInput = buttons[inputName];

            buttonInput.Inputs.Remove(button);
            if (buttonInput.Inputs.Count == 0)
            {
                buttons.Remove(inputName);
            }
            return(true);
        }
示例#3
0
 public static AxisInput FromKeyboard(Keys positiveKey, Keys negativeKey, ButtonInput modifier, float?sensitivity = null, float?gravity = null, float deadzone = 0.05f, bool reverse = false)
 => new AxisInput(new KeyAxisControl(positiveKey, negativeKey, sensitivity, gravity, deadzone, reverse), new ButtonInputSet(modifier));
示例#4
0
 public static AxisInput FromThumbStick(ThumbSticks thumbStick, ThumbSticksAxis thumbSticksAxis, ButtonInput modifier, float deadzone = 0.05f, bool reverse = false)
 => new AxisInput(new GamepadAxisControl(thumbStick, thumbSticksAxis, deadzone, reverse), new ButtonInputSet(modifier));
示例#5
0
 public static ButtonInput FromKeyboard(Keys key, ButtonInput modifier)
 => new ButtonInput(new KeyButtonControl(key), new ButtonInputSet(modifier));
示例#6
0
 public static ButtonInput FromGamepad(GamepadButtons button, ButtonInput modifier)
 => new ButtonInput(new GamepadButtonControl(button), new ButtonInputSet(modifier));