private int TranslateAxes(ref XInputGamePad pad) { var count = 0; count += pad.ThumbLX != 0 ? 1 : 0; count += pad.ThumbLY != 0 ? 1 : 0; count += pad.ThumbRX != 0 ? 1 : 0; count += pad.ThumbRY != 0 ? 1 : 0; count += pad.LeftTrigger != 0 ? 1 : 0; count += pad.RightTrigger != 0 ? 1 : 0; return(count); }
GamePadAxes TranslateAxes(ref XInputGamePad pad) { GamePadAxes axes = 0; axes |= pad.ThumbLX != 0 ? GamePadAxes.LeftX : 0; axes |= pad.ThumbLY != 0 ? GamePadAxes.LeftY : 0; axes |= pad.LeftTrigger != 0 ? GamePadAxes.LeftTrigger : 0; axes |= pad.ThumbRX != 0 ? GamePadAxes.RightX : 0; axes |= pad.ThumbRY != 0 ? GamePadAxes.RightY : 0; axes |= pad.RightTrigger != 0 ? GamePadAxes.RightTrigger : 0; return(axes); }
GamePadAxes TranslateAxes(ref XInputGamePad pad) { GamePadAxes axes = 0; axes |= pad.ThumbLX != 0 ? GamePadAxes.LeftX : 0; axes |= pad.ThumbLY != 0 ? GamePadAxes.LeftY : 0; axes |= pad.LeftTrigger != 0 ? GamePadAxes.LeftTrigger : 0; axes |= pad.ThumbRX != 0 ? GamePadAxes.RightX : 0; axes |= pad.ThumbRY != 0 ? GamePadAxes.RightY : 0; axes |= pad.RightTrigger != 0 ? GamePadAxes.RightTrigger : 0; return axes; }
int TranslateAxes(ref XInputGamePad pad) { int count = 0; count += pad.ThumbLX != 0 ? 1 : 0; count += pad.ThumbLY != 0 ? 1 : 0; count += pad.ThumbRX != 0 ? 1 : 0; count += pad.ThumbRY != 0 ? 1 : 0; count += pad.LeftTrigger != 0 ? 1 : 0; count += pad.RightTrigger != 0 ? 1 : 0; return count; }