ChargeSwitchDeadZone.cs 874 B

1234567891011121314151617181920212223242526272829
  1. #region File Description
  2. //-----------------------------------------------------------------------------
  3. // ChargeSwitchDeadZone.cs
  4. //
  5. // Microsoft XNA Community Game Platform
  6. // Copyright (C) Microsoft Corporation. All rights reserved.
  7. //-----------------------------------------------------------------------------
  8. #endregion
  9. #region Using Statements
  10. using System;
  11. using Microsoft.Xna.Framework.Input;
  12. #endregion
  13. namespace InputReporter
  14. {
  15. /// <summary>
  16. /// ChargeSwitch type for switching between dead-zone types.
  17. /// </summary>
  18. class ChargeSwitchDeadZone : ChargeSwitch
  19. {
  20. public ChargeSwitchDeadZone(float duration) : base(duration) { }
  21. protected override bool IsCharging(ref GamePadState gamePadState)
  22. {
  23. return (gamePadState.Buttons.Start == ButtonState.Pressed);
  24. }
  25. }
  26. }