diff -r 9e5a3854223936e5cc5299737d5ec50a715b2447 -r c4ca3b5877b088e13498689416cddb2d1b201416 axios/Engine/Extensions/InputState.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/axios/Engine/Extensions/InputState.cs Sun Jun 03 15:42:25 2012 -0500 @@ -0,0 +1,56 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using GameStateManagement; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Input; + +namespace Axios.Engine.Extensions +{ + public static class AxiosExtensions_InputState + { + // I got tired of always specifying Player one + //-- Nathan Adams [adamsna@datanethost.net] - 6/3/2012 + /// + /// This checks if the key is pressed by player one + /// + /// + /// + public static bool IsKeyPressed(this InputState input, Keys key) + { + PlayerIndex p; + return input.IsKeyPressed(key, PlayerIndex.One, out p); + } + + public static bool IsButtonPressed(this InputState input, Buttons button) + { + PlayerIndex p; + return input.IsButtonPressed(button, PlayerIndex.One, out p); + } + + public static bool IsNewKeyPress(this InputState input, Keys key) + { + PlayerIndex p; + return input.IsNewKeyPress(key, PlayerIndex.One, out p); + } + + public static bool IsNewButtonPress(this InputState input, Buttons button) + { + PlayerIndex p; + return input.IsNewButtonPress(button, PlayerIndex.One, out p); + } + + public static bool IsNewButtonRelease(this InputState input, Buttons button) + { + PlayerIndex p; + return input.IsNewButtonRelease(button, PlayerIndex.One, out p); + } + + public bool IsNewKeyRelease(this InputState input, Keys key) + { + PlayerIndex p; + return input.IsNewKeyRelease(key, PlayerIndex.One, out p); + } + } +}