private ISpriteGamePadState HandleStateInput(ISpriteGamePadState currentState, GamePadCapabilities cap, GamePadState gamepadState) { var newState = currentState.HandleInput(this, cap, gamepadState); if (newState != null) { return(newState); } return(currentState); }
public override void Update(GameTime gameTime) { GamePadCapabilities cap = GamePad.GetCapabilities(PlayerIndex.One); if (cap.IsConnected) { GamePadState gamepadState = GamePad.GetState(PlayerIndex.One); _state = HandleStateInput(_state, cap, gamepadState); _equipment = HandleStateInput(_equipment, cap, gamepadState); } _state.Update(this); _equipment.Update(this); }