axiosengine 

axiosengine Commit Details


Date:2012-05-28 17:01:03 (12 years 4 months ago)
Author:Natalie Adams
Branch:master
Commit:e31ccc4ed43391164fb6fabfe7b45a849c2f38f2
Parents: b828694e6988f26399e9116f5b5094f1df8836a0
Message:+ * - 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

Changes:

File differences

axios/Axios_settings.cs
9393
9494
9595
96
97
98
9699
97100
98101
* - 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
axios/Engine/AxiosCommandConsole.cs
5959
6060
6161
62
63
64
65
66
67
68
69
70
71
72
73
74
75
7662
77
78
79
80
81
82
8363
}
}
#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
axios/Engine/AxiosGameScreen.cs
4040
4141
4242
43
43
4444
45
45
4646
4747
48
4849
4950
5051
5152
5253
54
5355
5456
5557
......
104106
105107
106108
109
110
107111
108112
109113
110114
111115
112
116
113117
114118
115
116119
117120
118121
119
120122
121123
122
123124
125
124126
125127
126128
......
388390
389391
390392
391
393
394
395
392396
393397
394398
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()
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
}
#endif
if (obj is AxiosGameObject || obj is AxiosUIObject || obj is AxiosTimer)
{
AxiosGameObject tmp = obj as AxiosGameObject;
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);
axios/Engine/Extensions/String.cs
1
1
2
3
24
35
46
......
1618
1719
1820
21
22
23
24
25
26
27
28
29
30
31
1932
2033

using System.Text.RegularExpressions;
namespace Axios.Engine.Extensions
{
public static class AxiosExtensions_String
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;
}
}
}
axios/XNACC/CommandConsoleBase.cs
1
2
1
2
3
34
45
56
......
1314
1415
1516
16
1717
1818
1919
......
6969
7070
7171
72
72
7373
7474
7575
......
120120
121121
122122
123
124123
125124
126125
......
709708
710709
711710
712
713711
714712
715713
......
818816
819817
820818
821
822819
823
820
824821
825822
826823
......
29462943
29472944
29482945
2946
29492947
29502948
29512949
#region Using Statements
#if WINDOWS
#if WINDOWS
#region Using Statements
using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using System.Reflection;
using XNACC.BaseTypes;
using System.Diagnostics;
#endif
#endregion
/*
//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
/// <summary>Namespace that contains code related to the XNACC (CommandConsole) component</summary>
namespace XNACC.Console
{
}
#endregion
#region Command Object
/// <summary>This object contains information on a single Command that the console understands.</summary>
protected class CmdObject : IComparable< CmdObject >
}
}
#endregion
#region Initialization
/// <summary>Constructor for this base class</summary>
/// <param name="game">The Game object for the owning/managing game</param>
return;
}
#endregion
#region Graphics Content
/// <summary>Load content for this component</summary>
/// <summary>Load content for this component</summary>
/// <param name="content">The ContentManager that should be used </param>
public virtual void LoadContent( ContentManager content )
{
}
#endregion
}
}
#endif
axios/XNACC/CommandConsoleBaseSharedTypes.cs
1
1
2
23
34
45
56
7
8
9
610
7
811
912
1013
......
5356
5457
5558
59
5660
61
62
63
5764
5865
5966
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
/// <summary>Namespace that contains shared types related to the XNACC (CommandConsole) component</summary>
namespace XNACC.BaseTypes
{
}
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");
}

Archive Download the corresponding diff file

Branches

Number of commits:
Page rendered in 0.12672s using 14 queries.