ChargeSwitchExit.cs 743 B

12345678910111213141516171819202122232425
  1. //-----------------------------------------------------------------------------
  2. // ChargeSwitchExit.cs
  3. //
  4. // Microsoft XNA Community Game Platform
  5. // Copyright (C) Microsoft Corporation. All rights reserved.
  6. //-----------------------------------------------------------------------------
  7. using System;
  8. using Microsoft.Xna.Framework.Input;
  9. namespace InputReporter
  10. {
  11. /// <summary>
  12. /// ChargeSwitch type for exiting the game.
  13. /// </summary>
  14. class ChargeSwitchExit : ChargeSwitch
  15. {
  16. public ChargeSwitchExit(float duration) : base(duration) { }
  17. protected override bool IsCharging(ref GamePadState gamePadState)
  18. {
  19. return (gamePadState.Buttons.Back == ButtonState.Pressed);
  20. }
  21. }
  22. }