diff -r e4e852f5eba16c305cb6868c62b9e1472d4b9feb -r e6b6846e712f8acfe32ec32557e0024048496796 axios/Axios_settings.cs --- a/axios/Axios_settings.cs Sat May 26 23:23:22 2012 -0500 +++ b/axios/Axios_settings.cs Mon May 28 17:01:03 2012 -0500 @@ -93,6 +93,9 @@ * - Changing IAxiosFile.GetStream() to return Stream instead of FileStream * - Adding support for XNACC * - Fixed a bug where cleanup actions were being performed in Deactivate instead of Unload in AxiosGameScreen + * - Adding IsNullOrWhiteSpace extension for support for Xbox 360 + * - Upon some testing - developers will need to use #if WINDOWS/#endif tags to make sure they can't use XNACC in WP7/Xbox360 + * * */ #endregion diff -r e4e852f5eba16c305cb6868c62b9e1472d4b9feb -r e6b6846e712f8acfe32ec32557e0024048496796 axios/Engine/AxiosCommandConsole.cs --- a/axios/Engine/AxiosCommandConsole.cs Sat May 26 23:23:22 2012 -0500 +++ b/axios/Engine/AxiosCommandConsole.cs Mon May 28 17:01:03 2012 -0500 @@ -59,25 +59,5 @@ } } #else -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using Microsoft.Xna.Framework.Graphics; -namespace Axios.Engine -{ - public class AxiosCommandConsole - { - public bool Active = false; - public AxiosCommandConsole(AxiosGameScreen gameScreen) - { - } - - public AxiosCommandConsole(AxiosGameScreen gameScreen, SpriteFont font) - { - - } - } -} #endif \ No newline at end of file diff -r e4e852f5eba16c305cb6868c62b9e1472d4b9feb -r e6b6846e712f8acfe32ec32557e0024048496796 axios/Engine/AxiosGameScreen.cs --- a/axios/Engine/AxiosGameScreen.cs Sat May 26 23:23:22 2012 -0500 +++ b/axios/Engine/AxiosGameScreen.cs Mon May 28 17:01:03 2012 -0500 @@ -40,16 +40,18 @@ protected Level Level; private Camera camera; - +#if WINDOWS AxiosCommandConsole _console = null; - +#endif protected bool AllowKeyboardWhileConsoleIsActive = false; +#if WINDOWS public AxiosCommandConsole Console { get { return _console; } private set { _console = value; } } +#endif public AxiosGameScreen() : base() @@ -104,23 +106,23 @@ public void AddGameObject(object obj) { + +#if WINDOWS if (obj is AxiosCommandConsole) { if (_console != null) { //remove the current one first -#if WINDOWS + ScreenManager.Game.Components.Remove(_console); _console.Dispose(); -#endif _console = null; } _console = (AxiosCommandConsole)obj; -#if WINDOWS ScreenManager.Game.Components.Add(_console); _console.LoadContent(ScreenManager.Game.Content); + } #endif - } if (obj is AxiosGameObject || obj is AxiosUIObject || obj is AxiosTimer) { AxiosGameObject tmp = obj as AxiosGameObject; @@ -388,7 +390,9 @@ public override void HandleInput(GameTime gameTime, InputState input) { - if ((AllowKeyboardWhileConsoleIsActive && _console.Active) || !_console.Active) +#if WINDOWS + if (_console == null || !_console.Active || (AllowKeyboardWhileConsoleIsActive && _console.Active) ) +#endif { base.HandleInput(gameTime, input); diff -r e4e852f5eba16c305cb6868c62b9e1472d4b9feb -r e6b6846e712f8acfe32ec32557e0024048496796 axios/Engine/Extensions/String.cs --- a/axios/Engine/Extensions/String.cs Sat May 26 23:23:22 2012 -0500 +++ b/axios/Engine/Extensions/String.cs Mon May 28 17:01:03 2012 -0500 @@ -1,4 +1,6 @@ - +using System.Text.RegularExpressions; + + namespace Axios.Engine.Extensions { public static class AxiosExtensions_String @@ -16,5 +18,16 @@ int len = end - start; // Calculate length return source.Substring(start, len); // Return Substring of length } + + public static bool IsNullOrWhiteSpace(this string str) + { + if (str == null || str == string.Empty) + return true; + + if (Regex.Match(str, "([:blank:])").Success) + return true; + + return false; + } } } \ No newline at end of file diff -r e4e852f5eba16c305cb6868c62b9e1472d4b9feb -r e6b6846e712f8acfe32ec32557e0024048496796 axios/XNACC/CommandConsoleBase.cs --- a/axios/XNACC/CommandConsoleBase.cs Sat May 26 23:23:22 2012 -0500 +++ b/axios/XNACC/CommandConsoleBase.cs Mon May 28 17:01:03 2012 -0500 @@ -1,5 +1,6 @@ -#region Using Statements -#if WINDOWS +#if WINDOWS +#region Using Statements + using System; using System.Collections.Generic; using Microsoft.Xna.Framework; @@ -13,7 +14,6 @@ using System.Reflection; using XNACC.BaseTypes; using System.Diagnostics; -#endif #endregion /* @@ -69,7 +69,7 @@ //NA: XNACC currently is only supported on Windows due to the fact that SortedDictionary is not avaiable on WP7/Xbox 360 //NA: Seriously Microsoft? -#if WINDOWS + /// Namespace that contains code related to the XNACC (CommandConsole) component namespace XNACC.Console { @@ -120,7 +120,6 @@ } #endregion - #region Command Object /// This object contains information on a single Command that the console understands. protected class CmdObject : IComparable< CmdObject > @@ -709,7 +708,6 @@ } } #endregion - #region Initialization /// Constructor for this base class /// The Game object for the owning/managing game @@ -818,9 +816,8 @@ return; } #endregion - #region Graphics Content - /// Load content for this component + /// Load content for this component /// The ContentManager that should be used public virtual void LoadContent( ContentManager content ) { @@ -2946,6 +2943,7 @@ } #endregion + } } #endif \ No newline at end of file diff -r e4e852f5eba16c305cb6868c62b9e1472d4b9feb -r e6b6846e712f8acfe32ec32557e0024048496796 axios/XNACC/CommandConsoleBaseSharedTypes.cs --- a/axios/XNACC/CommandConsoleBaseSharedTypes.cs Sat May 26 23:23:22 2012 -0500 +++ b/axios/XNACC/CommandConsoleBaseSharedTypes.cs Mon May 28 17:01:03 2012 -0500 @@ -1,10 +1,13 @@ -using System; +#if WINDOWS +using System; using System.Collections.Generic; using System.Linq; using System.Text; using Microsoft.Xna.Framework.Input; +using Axios.Engine.Extensions; -#if WINDOWS + + /// Namespace that contains shared types related to the XNACC (CommandConsole) component namespace XNACC.BaseTypes { @@ -53,7 +56,11 @@ } protected set { +#if WINDOWS || WINDOWS_PHONE7 if (String.IsNullOrWhiteSpace(value)) +#else + if (value.IsNullOrWhiteSpace()) +#endif { throw new ArgumentNullException("The name for a console variable cannot be null, empty, or whitespace"); }