#region File Description //----------------------------------------------------------------------------- // InputHelper.cs // // Microsoft XNA Community Game Platform // Copyright (C) Microsoft Corporation. All rights reserved. //----------------------------------------------------------------------------- #endregion #region Using Statements using System; using Microsoft.Xna.Framework; #endregion namespace Marblets { /// /// Provides a wrapper around the gamepads to allow single button presses to be /// detected also provides keyboard aliasing to allow keyboards to be used to play /// public class InputHelper : GameComponent { /// /// Current pressed state of the gamepads /// static public GamePads GamePads = new GamePads(); /// /// Initializes a new instance of the class. /// /// Game the game component should be attached to. public InputHelper(Game game) : base(game) { } /// /// Called when the GameComponent needs to be updated. This polls all the game /// pads and updates the state /// /// Current game time public override void Update(GameTime gameTime) { base.Update(gameTime); GamePads.Update(this.Game); } } }