Exemplo n.º 1
0
 /// <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);
 }
Exemplo n.º 2
0
 /// <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) => new ButtonStateDifference(lastButtons.Except(this).ToArray(), this.Except(lastButtons).ToArray());