/// <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 ButtonStateDifference EnumerateDifference(ButtonStates <TButton> lastButtons) { return(new ButtonStateDifference(lastButtons.Except(this).ToArray(), this.Except(lastButtons).ToArray())); }