/// <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; }
/// <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); }
/// <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; }
/// <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); }
public ButtonAction(AbstractButtonInput bt, ButtonChallengeType type, bool chained) { buttonID = bt; challengeID = type; connecting = chained; }
/// <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))); }