Beispiel #1
0
 /// <summary>Get the status of a button relative to its previous status.</summary>
 /// <param name="oldStatus">The previous button status.</param>
 /// <param name="isDown">Whether the button is currently down.</param>
 private InputStatus DeriveStatus(InputStatus oldStatus, bool isDown)
 {
     if (isDown && oldStatus.IsDown())
     {
         return(InputStatus.Held);
     }
     if (isDown)
     {
         return(InputStatus.Pressed);
     }
     return(InputStatus.Released);
 }
Beispiel #2
0
 /*********
 ** Private methods
 *********/
 /// <summary>Get the status of a button.</summary>
 /// <param name="oldStatus">The previous button status.</param>
 /// <param name="isDown">Whether the button is currently down.</param>
 public InputStatus GetStatus(InputStatus oldStatus, bool isDown)
 {
     if (isDown && oldStatus.IsDown())
     {
         return(InputStatus.Held);
     }
     if (isDown)
     {
         return(InputStatus.Pressed);
     }
     return(InputStatus.Released);
 }