From 13857f324d049ac070db858c26d2126d2f473109 Mon Sep 17 00:00:00 2001 From: Nathan Adams Date: Sat, 26 May 2012 18:50:49 -0500 Subject: [PATCH] Adding AxiosCommandConsole for easy intergration with AxiosGameScreens Adding the ability to get the InputState object from the ScreenManager --HG-- branch : xnacc-integration --- axios/Axios_WP7.csproj | 1 + axios/Axios_Windows.csproj | 1 + axios/Axios_Xbox_360.csproj | 1 + axios/Engine/AxiosCommandConsole.cs | 26 ++++++++++++++++++++++++++ axios/ScreenSystem/ScreenManager.cs | 5 +++++ 5 files changed, 34 insertions(+) create mode 100644 axios/Engine/AxiosCommandConsole.cs diff --git a/axios/Axios_WP7.csproj b/axios/Axios_WP7.csproj index 897dcf9..9df37ff 100644 --- a/axios/Axios_WP7.csproj +++ b/axios/Axios_WP7.csproj @@ -155,6 +155,7 @@ + diff --git a/axios/Axios_Windows.csproj b/axios/Axios_Windows.csproj index 195fc78..8d24a3f 100644 --- a/axios/Axios_Windows.csproj +++ b/axios/Axios_Windows.csproj @@ -98,6 +98,7 @@ + diff --git a/axios/Axios_Xbox_360.csproj b/axios/Axios_Xbox_360.csproj index 9ce7f6f..33ed00a 100644 --- a/axios/Axios_Xbox_360.csproj +++ b/axios/Axios_Xbox_360.csproj @@ -149,6 +149,7 @@ + diff --git a/axios/Engine/AxiosCommandConsole.cs b/axios/Engine/AxiosCommandConsole.cs new file mode 100644 index 0000000..1251e09 --- /dev/null +++ b/axios/Engine/AxiosCommandConsole.cs @@ -0,0 +1,26 @@ +#if WINDOWS +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using XNACC.Console; +using Microsoft.Xna.Framework.Graphics; + +namespace Axios.Engine +{ + class AxiosCommandConsole : CommandConsoleBase + { + public AxiosCommandConsole(AxiosGameScreen gameScreen) + : base(gameScreen.ScreenManager.Game) + { + Keyboard = gameScreen.ScreenManager.InputState; + } + + public AxiosCommandConsole(AxiosGameScreen gameScreen, SpriteFont font) + : base(gameScreen.ScreenManager.Game, font) + { + Keyboard = gameScreen.ScreenManager.InputState; + } + } +} +#endif \ No newline at end of file diff --git a/axios/ScreenSystem/ScreenManager.cs b/axios/ScreenSystem/ScreenManager.cs index dcd2545..eb4f79d 100644 --- a/axios/ScreenSystem/ScreenManager.cs +++ b/axios/ScreenSystem/ScreenManager.cs @@ -57,6 +57,11 @@ namespace GameStateManagement #region Properties + public InputState InputState + { + get { return input; } + private set { input = value; } + } public SpriteFonts Fonts {