public void Update() { prevState = state; state = GamePad.GetState(playerIndex); prevDPadDirection = dPadDirection; dPadDirection = GetDPadDirection(); }
#pragma warning restore 0649 protected override void InputUpdate() { XInput.Direction direction = XInput.GetDPadDirection(playerIndex); foreach (DPadDirection dPadDirection in dPadDirections) { // That way, we only enable the current direction's image dPadDirection.EnableImage(dPadDirection.IsConcerned(direction)); } }
#pragma warning restore 0649 public bool IsConcerned(XInput.Direction direction) { return(this.direction == direction); }