Exemplo n.º 1
0
        /// <summary>
        /// Returns the state of a specified button on a specified controller
        /// </summary>
        /// <param name="bttnInpt">ID of button to check against</param>
        /// <param name="plyrID">ID of corresponding player to check against</param>
        /// <returns></returns>
        public static bool GetButton(AbstractButtonInput bttnInpt, PlayerID plyrID = PlayerID.FIRST) {
            InputForm curInForm = GetCurrentState(plyrID);          // Current Input form

            if (GetButtonState(curInForm, AbstractToButtonID(bttnInpt)) == buttonState.PRESSED) { return true; }

            return false;
        }
Exemplo n.º 2
0
        /// <summary>
        /// Returns the state of a specified button on a specified controller
        /// </summary>
        /// <param name="bttnInpt">ID of button to check against</param>
        /// <param name="plyrID">ID of corresponding player to check against</param>
        /// <returns></returns>
        public static bool GetButton(AbstractButtonInput bttnInpt, PlayerID plyrID = PlayerID.FIRST)
        {
            InputForm curInForm = GetCurrentState(plyrID);          // Current Input form

            if (GetButtonState(curInForm, AbstractToButtonID(bttnInpt)) == buttonState.PRESSED)
            {
                return(true);
            }

            return(false);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Returns true during the frame the user releases the button
        /// </summary>
        /// <param name="bttnInpt">ID of button to check against</param>
        /// <param name="plyrID">ID of corresponding player to check against</param>
        /// <returns></returns>
        public static bool GetButtonUp(AbstractButtonInput bttnInpt, PlayerID plyrID = PlayerID.FIRST) {
            InputForm curInForm = GetCurrentState(plyrID);
            InputForm prevInForm = GetPreviousState(plyrID);

            if ((GetButtonState(curInForm, AbstractToButtonID(bttnInpt)) == buttonState.RELEASED) &&
                    (GetButtonState(prevInForm, AbstractToButtonID(bttnInpt)) == buttonState.PRESSED)) {
                return true;
            }

            return false;
        }
Exemplo n.º 4
0
        /// <summary>
        /// Returns true during the frame the user releases the button
        /// </summary>
        /// <param name="bttnInpt">ID of button to check against</param>
        /// <param name="plyrID">ID of corresponding player to check against</param>
        /// <returns></returns>
        public static bool GetButtonUp(AbstractButtonInput bttnInpt, PlayerID plyrID = PlayerID.FIRST)
        {
            InputForm curInForm  = GetCurrentState(plyrID);
            InputForm prevInForm = GetPreviousState(plyrID);

            if ((GetButtonState(curInForm, AbstractToButtonID(bttnInpt)) == buttonState.RELEASED) &&
                (GetButtonState(prevInForm, AbstractToButtonID(bttnInpt)) == buttonState.PRESSED))
            {
                return(true);
            }

            return(false);
        }
Exemplo n.º 5
0
 public ButtonAction(AbstractButtonInput bt, ButtonChallengeType type, bool chained) {
     buttonID = bt;
     challengeID = type;
     connecting = chained;
 }
Exemplo n.º 6
0
 /// <summary>
 /// Converts abstract button input enum into generic ButtonID
 /// </summary>
 /// <param name="bttnID">Enum to translate</param>
 /// <returns></returns>
 public static GenericButtonID AbstractToButtonID(this AbstractButtonInput bttnID)
 {
     return((GenericButtonID)((bttnID)));
 }
Exemplo n.º 7
0
 public ButtonAction(AbstractButtonInput bt, ButtonChallengeType type, bool chained)
 {
     buttonID    = bt;
     challengeID = type;
     connecting  = chained;
 }