diff --git a/ANX.Framework/Audio/AudioCategory.cs b/ANX.Framework/Audio/AudioCategory.cs index 7a609e06..12ef257a 100644 --- a/ANX.Framework/Audio/AudioCategory.cs +++ b/ANX.Framework/Audio/AudioCategory.cs @@ -52,8 +52,70 @@ using System; namespace ANX.Framework.Audio { - public struct AudioCategory + public struct AudioCategory : IEquatable { + public void Pause() + { + throw new NotImplementedException(); + } + + public void Resume() + { + throw new NotImplementedException(); + } + + public void SetVolume(float volume) + { + throw new NotImplementedException(); + } + + public void Stop(AudioStopOptions options) + { + throw new NotImplementedException(); + } + + public string Name + { + get + { + throw new NotImplementedException(); + } + } + + public override int GetHashCode() + { + throw new NotImplementedException(); + } + + public override string ToString() + { + throw new NotImplementedException(); + } + + public override bool Equals(object obj) + { + if (obj != null && obj.GetType() == this.GetType()) + { + return this == (AudioCategory)obj; + } + + return false; + } + + public bool Equals(AudioCategory other) + { + return this == other; + } + + public static bool operator ==(AudioCategory lhs, AudioCategory rhs) + { + throw new NotImplementedException(); + } + + public static bool operator !=(AudioCategory lhs, AudioCategory rhs) + { + throw new NotImplementedException(); + } } } diff --git a/ANX.Framework/Audio/RendererDetail.cs b/ANX.Framework/Audio/RendererDetail.cs index 99fd9916..04b73426 100644 --- a/ANX.Framework/Audio/RendererDetail.cs +++ b/ANX.Framework/Audio/RendererDetail.cs @@ -55,5 +55,50 @@ namespace ANX.Framework.Audio public struct RendererDetail { + public string FriendlyName + { + get + { + throw new NotImplementedException(); + } + } + + public string RendererId + { + get + { + throw new NotImplementedException(); + } + } + + public override int GetHashCode() + { + throw new NotImplementedException(); + } + + public override string ToString() + { + throw new NotImplementedException(); + } + + public override bool Equals(object obj) + { + if (obj != null && obj.GetType() == this.GetType()) + { + return this == (RendererDetail)obj; + } + + return false; + } + + public static bool operator ==(RendererDetail lhs, RendererDetail rhs) + { + return lhs.FriendlyName.Equals(rhs.FriendlyName) && lhs.RendererId.Equals(rhs.RendererId); + } + + public static bool operator !=(RendererDetail lhs, RendererDetail rhs) + { + return !lhs.FriendlyName.Equals(rhs.FriendlyName) || !lhs.RendererId.Equals(rhs.RendererId); + } } } diff --git a/ANX.Framework/GamerServices/AvatarExpression.cs b/ANX.Framework/GamerServices/AvatarExpression.cs index bdc61b7c..01cad7a9 100644 --- a/ANX.Framework/GamerServices/AvatarExpression.cs +++ b/ANX.Framework/GamerServices/AvatarExpression.cs @@ -55,6 +55,14 @@ namespace ANX.Framework.GamerServices { public struct AvatarExpression { + public AvatarEye LeftEye { get; set; } + public AvatarEyebrow LeftEyebrow { get; set; } + + public AvatarMouth Mouth { get; set; } + + public AvatarEye RightEye { get; set; } + + public AvatarEyebrow RightEyebrow { get; set; } } } diff --git a/ANX.Framework/GamerServices/LeaderboardIdentity.cs b/ANX.Framework/GamerServices/LeaderboardIdentity.cs index 66e47acc..b45aeab1 100644 --- a/ANX.Framework/GamerServices/LeaderboardIdentity.cs +++ b/ANX.Framework/GamerServices/LeaderboardIdentity.cs @@ -54,6 +54,26 @@ namespace ANX.Framework.GamerServices { public struct LeaderboardIdentity { + public static LeaderboardIdentity Create(LeaderboardKey key) + { + throw new NotSupportedException("Games for Windows LIVE is not supported in ANX"); + } + public static LeaderboardIdentity Create(LeaderboardKey key, int gameMode) + { + throw new NotSupportedException("Games for Windows LIVE is not supported in ANX"); + } + + public int GameMode + { + get; + set; + } + + public string Key + { + get; + set; + } } } diff --git a/ANX.Framework/Graphics/VertexElement.cs b/ANX.Framework/Graphics/VertexElement.cs index 6f60a638..70cfed83 100644 --- a/ANX.Framework/Graphics/VertexElement.cs +++ b/ANX.Framework/Graphics/VertexElement.cs @@ -54,10 +54,13 @@ namespace ANX.Framework.Graphics { public struct VertexElement { + #region Private Members private int offset; private VertexElementFormat elementFormat; private VertexElementUsage elementUsage; private int usageIndex; + + #endregion // Private Members public VertexElement(int offset, VertexElementFormat elementFormat, VertexElementUsage elementUsage, int usageIndex) { @@ -114,5 +117,35 @@ namespace ANX.Framework.Graphics this.usageIndex = value; } } + + public override int GetHashCode() + { + throw new NotImplementedException(); + } + + public override string ToString() + { + return string.Format("{{Offset:{0} Format:{1} Usage:{2} UsageIndex:{3}}}", this.offset, this.elementFormat, this.elementUsage, this.usageIndex); + } + + public override bool Equals(object obj) + { + if (obj != null && obj.GetType() == this.GetType()) + { + return this == (VertexElement)obj; + } + + return false; + } + + public static bool operator ==(VertexElement lhs, VertexElement rhs) + { + return lhs.offset == rhs.offset && lhs.elementFormat == rhs.elementFormat && lhs.elementUsage == rhs.elementUsage && lhs.usageIndex == rhs.usageIndex; + } + + public static bool operator !=(VertexElement lhs, VertexElement rhs) + { + return lhs.offset != rhs.offset || lhs.elementFormat != rhs.elementFormat || lhs.elementUsage != rhs.elementUsage || lhs.usageIndex == rhs.usageIndex; + } } } diff --git a/ANX.Framework/Input/Touch/GestureSample.cs b/ANX.Framework/Input/Touch/GestureSample.cs index fe6e35e0..77260ea6 100644 --- a/ANX.Framework/Input/Touch/GestureSample.cs +++ b/ANX.Framework/Input/Touch/GestureSample.cs @@ -54,6 +54,72 @@ namespace ANX.Framework.Input.Touch { public struct GestureSample { + #region Private Members + private GestureType gestureType; + private TimeSpan timestamp; + private Vector2 position; + private Vector2 position2; + private Vector2 delta; + private Vector2 delta2; + #endregion // Private Members + + public GestureSample(GestureType gestureType, TimeSpan timestamp, Vector2 position, Vector2 position2, Vector2 delta, Vector2 delta2) + { + this.gestureType = gestureType; + this.timestamp = timestamp; + this.position = position; + this.position2 = position2; + this.delta = delta; + this.delta2 = delta2; + } + + public Vector2 Delta + { + get + { + return this.delta; + } + } + + public Vector2 Delta2 + { + get + { + return this.delta2; + } + } + + public GestureType GestureType + { + get + { + return this.gestureType; + } + } + + public Vector2 Position + { + get + { + return this.position; + } + } + + public Vector2 Position2 + { + get + { + return this.position2; + } + } + + public TimeSpan Timestamp + { + get + { + return this.timestamp; + } + } } } diff --git a/ANX.Framework/Input/Touch/TouchCollection.cs b/ANX.Framework/Input/Touch/TouchCollection.cs index fbeb7add..a6fd5926 100644 --- a/ANX.Framework/Input/Touch/TouchCollection.cs +++ b/ANX.Framework/Input/Touch/TouchCollection.cs @@ -56,6 +56,10 @@ namespace ANX.Framework.Input.Touch { public struct TouchCollection : IList, ICollection, IEnumerable, IEnumerable { + public TouchCollection(TouchLocation[] touches) + { + throw new NotImplementedException(); + } public int IndexOf(TouchLocation item) { @@ -104,11 +108,24 @@ namespace ANX.Framework.Input.Touch throw new NotImplementedException(); } + public bool FindById(int id, out TouchLocation touchLocation) + { + throw new NotImplementedException(); + } + public int Count { get { throw new NotImplementedException(); } } + public bool IsConnected + { + get + { + throw new NotImplementedException(); + } + } + public bool IsReadOnly { get { throw new NotImplementedException(); } @@ -119,7 +136,12 @@ namespace ANX.Framework.Input.Touch throw new NotImplementedException(); } - public IEnumerator GetEnumerator() + public Enumerator GetEnumerator() + { + return new Enumerator(this); + } + + IEnumerator IEnumerable.GetEnumerator() { throw new NotImplementedException(); } @@ -128,5 +150,52 @@ namespace ANX.Framework.Input.Touch { throw new NotImplementedException(); } + + public struct Enumerator : IEnumerator, IDisposable, IEnumerator + { + private TouchCollection collection; + private int position; + internal Enumerator(TouchCollection collection) + { + this.collection = collection; + this.position = -1; + } + + public TouchLocation Current + { + get + { + return this.collection[this.position]; + } + } + public bool MoveNext() + { + this.position++; + if (this.position >= this.collection.Count) + { + this.position = this.collection.Count; + return false; + } + return true; + } + + void IEnumerator.Reset() + { + this.position = -1; + } + + public void Dispose() + { + } + + object IEnumerator.Current + { + get + { + return this.Current; + } + } + } + } } diff --git a/ANX.Framework/Input/Touch/TouchLocation.cs b/ANX.Framework/Input/Touch/TouchLocation.cs index 985ad0f6..42d24eec 100644 --- a/ANX.Framework/Input/Touch/TouchLocation.cs +++ b/ANX.Framework/Input/Touch/TouchLocation.cs @@ -54,10 +54,112 @@ namespace ANX.Framework.Input.Touch { public struct TouchLocation : IEquatable { + #region Private members + private int id; + private TouchLocationState prevState; + private Vector2 prevPos; + private TouchLocationState state; + private Vector2 pos; + + #endregion // Private members + + public TouchLocation(int id, TouchLocationState state, Vector2 position) + { + this.id = id; + this.state = state; + this.pos = position; + this.prevState = TouchLocationState.Invalid; + this.prevPos = Vector2.Zero; + } + + public TouchLocation(int id, TouchLocationState state, Vector2 position, TouchLocationState previousState, Vector2 previousPosition) + { + this.id = id; + this.state = state; + this.pos = position; + this.prevState = previousState; + this.prevPos = previousPosition; + } + + public bool TryGetPreviousLocation(out TouchLocation previousLocation) + { + if (this.prevState == TouchLocationState.Invalid) + { + previousLocation.id = -1; + previousLocation.state = TouchLocationState.Invalid; + previousLocation.pos = Vector2.Zero; + previousLocation.prevState = TouchLocationState.Invalid; + previousLocation.prevPos = Vector2.Zero; + + return false; + } + + previousLocation.id = this.id; + previousLocation.state = this.prevState; + previousLocation.pos = this.pos; + previousLocation.prevState = TouchLocationState.Invalid; + previousLocation.prevPos = this.prevPos; + + return true; + } + + public override string ToString() + { + return string.Format("{{Position:{0}}}", this.pos); + } + + public override int GetHashCode() + { + return this.id.GetHashCode() + this.pos.X.GetHashCode() + this.pos.Y.GetHashCode(); + } + + public override bool Equals(Object other) + { + if (other != null && other.GetType() == this.GetType()) + { + return this == (TouchLocation)other; + } + + return false; + } public bool Equals(TouchLocation other) { - throw new NotImplementedException(); + return this.id == other.id && this.pos == other.pos && this.prevPos == other.prevPos; + } + + public static bool operator ==(TouchLocation lhs, TouchLocation rhs) + { + return lhs.id == rhs.id && lhs.pos == rhs.pos && lhs.prevPos == rhs.prevPos; + } + + public static bool operator !=(TouchLocation lhs, TouchLocation rhs) + { + return lhs.id != rhs.id || lhs.pos != rhs.pos || lhs.prevPos != rhs.prevPos; + } + + public int Id + { + get + { + return this.id; + } + } + + public Vector2 Position + { + get + { + return this.pos; + } + } + + public TouchLocationState State + { + get + { + return this.state; + } } } } diff --git a/ANX.Framework/Input/Touch/TouchPanelCapabilities.cs b/ANX.Framework/Input/Touch/TouchPanelCapabilities.cs index 9673f32b..4c1bf1d1 100644 --- a/ANX.Framework/Input/Touch/TouchPanelCapabilities.cs +++ b/ANX.Framework/Input/Touch/TouchPanelCapabilities.cs @@ -55,5 +55,17 @@ namespace ANX.Framework.Input.Touch public struct TouchPanelCapabilities { + public bool IsConnected + { + get; + set; + } + + public int MaximumTouchCount + { + get; + set; + } + } }