public KeyboardKeyInput(ButtonStates <Key> current, ButtonStates <Key> previous) : base(current, previous) { }
/// <summary> /// Copies the state of another <see cref="ButtonStates{TButton}"/> to ourselves. /// </summary> /// <param name="other">The <see cref="ButtonStates{TButton}"/> to copy.</param> public void Set(ButtonStates <TButton> other) { pressedButtons.Clear(); pressedButtons.AddRange(other.pressedButtons); }
/// <summary> /// Enumerates the differences between ourselves and a previous <see cref="ButtonStates{TButton}"/>. /// </summary> /// <param name="lastButtons">The previous <see cref="ButtonStates{TButton}"/>.</param> public (IEnumerable <TButton> Released, IEnumerable <TButton> Pressed) EnumerateDifference(ButtonStates <TButton> lastButtons) { return(lastButtons.pressedButtons.Except(pressedButtons), pressedButtons.Except(lastButtons.pressedButtons)); }
public JoystickButtonInput(ButtonStates <JoystickButton> current, ButtonStates <JoystickButton> previous) : base(current, previous) { }
/// <summary> /// Enumerates the differences between ourselves and a previous <see cref="ButtonStates{TButton}"/>. /// </summary> /// <param name="lastButtons">The previous <see cref="ButtonStates{TButton}"/>.</param> public ButtonStateDifference EnumerateDifference(ButtonStates <TButton> lastButtons) { return(new ButtonStateDifference(lastButtons.Except(this).ToArray(), this.Except(lastButtons).ToArray())); }
public MouseButtonInput(ButtonStates <MouseButton> current, ButtonStates <MouseButton> previous) : base(current, previous) { }