public ButtonInputSet(ButtonInput input) { if (input == null) { throw new ArgumentNullException(nameof(input)); } Inputs = new List <ButtonInput> { input }; }
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); }
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));
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));
public static ButtonInput FromKeyboard(Keys key, ButtonInput modifier) => new ButtonInput(new KeyButtonControl(key), new ButtonInputSet(modifier));
public static ButtonInput FromGamepad(GamepadButtons button, ButtonInput modifier) => new ButtonInput(new GamepadButtonControl(button), new ButtonInputSet(modifier));