// Autogenerated C# message buffer code. // Source: clad/gateway/messageRobotToExternal.clad // Full command line: victor-clad/tools/message-buffers/emitters/CSharp_emitter.py -C src -I clad/src lib/util/source/anki/clad robot/clad/src coretech/vision/clad_src coretech/common/clad_src -o generated/cladCSharp clad/gateway/messageRobotToExternal.clad namespace Anki { namespace Vector { namespace Gateway { public partial class UiDeviceConnected { private string _placeholder; // string[uint_8] public string placeholder { get { return _placeholder; } set { if (!string.IsNullOrEmpty(value) && System.Text.Encoding.UTF8.GetByteCount(value) > 255) { throw new System.ArgumentException("placeholder string is too long. Must decode to less than or equal to 255 bytes.", "value"); } _placeholder = value; } } /**** Constructors ****/ public UiDeviceConnected() { } public UiDeviceConnected(string placeholder) { this.placeholder = placeholder; } public UiDeviceConnected(System.IO.Stream stream) { Unpack(stream); } public UiDeviceConnected(System.IO.BinaryReader reader) { Unpack(reader); } public UiDeviceConnected Initialize(string placeholder) { this.placeholder = placeholder; return this; } public void Unpack(System.IO.Stream stream) { System.IO.BinaryReader reader = new System.IO.BinaryReader(stream); Unpack(reader); } public void Unpack(System.IO.BinaryReader reader) { int _placeholder_length = (int)reader.ReadByte(); byte[] _placeholder_bytes = reader.ReadBytes(_placeholder_length); _placeholder = System.Text.Encoding.UTF8.GetString(_placeholder_bytes); } public void Pack(System.IO.Stream stream) { System.IO.BinaryWriter writer = new System.IO.BinaryWriter(stream); Pack(writer); } public void Pack(System.IO.BinaryWriter writer) { if (_placeholder != null) { byte[] _placeholder_bytes = System.Text.Encoding.UTF8.GetBytes(_placeholder); writer.Write((byte)_placeholder_bytes.Length); writer.Write(_placeholder_bytes); } else { writer.Write((byte)0); } } public int Size { get { int result = 0; result += 1; // uint_8 if (placeholder != null) { result += System.Text.Encoding.UTF8.GetByteCount(placeholder); } return result; } } public static bool ArrayEquals(System.Collections.Generic.IList a1, System.Collections.Generic.IList a2) { if (System.Object.ReferenceEquals(a1, a2)) return true; if (System.Object.ReferenceEquals(a1, null) || System.Object.ReferenceEquals(a2, null)) return false; if (a1.Count != a2.Count) return false; for (int i = 0; i < a1.Count; i++) { if (!a1[i].Equals(a2[i])) { return false; } } return true; } public static bool operator ==(UiDeviceConnected a, UiDeviceConnected b) { if (System.Object.ReferenceEquals(a, null)) { return System.Object.ReferenceEquals(b, null); } return a.Equals(b); } public static bool operator !=(UiDeviceConnected a, UiDeviceConnected b) { return !(a == b); } public override bool Equals(System.Object obj) { return this.Equals(obj as UiDeviceConnected); } public bool Equals(UiDeviceConnected p) { if (System.Object.ReferenceEquals(p, null)) { return false; } return this._placeholder.Equals(p._placeholder); } public override int GetHashCode() { unchecked { int hash = 17; return hash; } } } public partial class AnimationCompleted { private string _animationName; // string[uint_8] public string animationName { get { return _animationName; } set { if (!string.IsNullOrEmpty(value) && System.Text.Encoding.UTF8.GetByteCount(value) > 255) { throw new System.ArgumentException("animationName string is too long. Must decode to less than or equal to 255 bytes.", "value"); } _animationName = value; } } /**** Constructors ****/ public AnimationCompleted() { } public AnimationCompleted(string animationName) { this.animationName = animationName; } public AnimationCompleted(System.IO.Stream stream) { Unpack(stream); } public AnimationCompleted(System.IO.BinaryReader reader) { Unpack(reader); } public AnimationCompleted Initialize(string animationName) { this.animationName = animationName; return this; } public void Unpack(System.IO.Stream stream) { System.IO.BinaryReader reader = new System.IO.BinaryReader(stream); Unpack(reader); } public void Unpack(System.IO.BinaryReader reader) { int _animationName_length = (int)reader.ReadByte(); byte[] _animationName_bytes = reader.ReadBytes(_animationName_length); _animationName = System.Text.Encoding.UTF8.GetString(_animationName_bytes); } public void Pack(System.IO.Stream stream) { System.IO.BinaryWriter writer = new System.IO.BinaryWriter(stream); Pack(writer); } public void Pack(System.IO.BinaryWriter writer) { if (_animationName != null) { byte[] _animationName_bytes = System.Text.Encoding.UTF8.GetBytes(_animationName); writer.Write((byte)_animationName_bytes.Length); writer.Write(_animationName_bytes); } else { writer.Write((byte)0); } } public int Size { get { int result = 0; result += 1; // uint_8 if (animationName != null) { result += System.Text.Encoding.UTF8.GetByteCount(animationName); } return result; } } public static bool ArrayEquals(System.Collections.Generic.IList a1, System.Collections.Generic.IList a2) { if (System.Object.ReferenceEquals(a1, a2)) return true; if (System.Object.ReferenceEquals(a1, null) || System.Object.ReferenceEquals(a2, null)) return false; if (a1.Count != a2.Count) return false; for (int i = 0; i < a1.Count; i++) { if (!a1[i].Equals(a2[i])) { return false; } } return true; } public static bool operator ==(AnimationCompleted a, AnimationCompleted b) { if (System.Object.ReferenceEquals(a, null)) { return System.Object.ReferenceEquals(b, null); } return a.Equals(b); } public static bool operator !=(AnimationCompleted a, AnimationCompleted b) { return !(a == b); } public override bool Equals(System.Object obj) { return this.Equals(obj as AnimationCompleted); } public bool Equals(AnimationCompleted p) { if (System.Object.ReferenceEquals(p, null)) { return false; } return this._animationName.Equals(p._animationName); } public override int GetHashCode() { unchecked { int hash = 17; return hash; } } } public class ActionCompletedUnion { public enum Tag { animationCompleted = 0x1, // 1 INVALID = 255 }; private Tag _tag = Tag.INVALID; public Tag GetTag() { return _tag; } private object _state = null; public object GetState() { return _state; } public Anki.Vector.Gateway.AnimationCompleted animationCompleted { get { if (_tag != Tag.animationCompleted) { throw new System.InvalidOperationException(string.Format( "Cannot access union member \"animationCompleted\" when a value of type {0} is stored.", _tag.ToString())); } return (Anki.Vector.Gateway.AnimationCompleted)this._state; } set { _tag = (value != null) ? Tag.animationCompleted : Tag.INVALID; _state = value; } } public ActionCompletedUnion Initialize(T state) { _state = state; if(typeof(T) == typeof(Anki.Vector.Gateway.AnimationCompleted)) { _tag = Tag.animationCompleted; } else { _state = null; _tag = Tag.INVALID; } return this; } /**** Constructors ****/ public ActionCompletedUnion() { } public ActionCompletedUnion(System.IO.Stream stream) { Unpack(stream); } public ActionCompletedUnion(System.IO.BinaryReader reader) { Unpack(reader); } public void Unpack(System.IO.Stream stream) { System.IO.BinaryReader reader = new System.IO.BinaryReader(stream); Unpack(reader); } public void Unpack(System.IO.BinaryReader reader) { Tag newTag = (Tag)reader.ReadByte(); switch(newTag) { case Tag.animationCompleted: animationCompleted = new Anki.Vector.Gateway.AnimationCompleted(reader); break; default: break; } _tag = newTag; } public void Pack(System.IO.Stream stream) { System.IO.BinaryWriter writer = new System.IO.BinaryWriter(stream); Pack(writer); } public void Pack(System.IO.BinaryWriter writer) { writer.Write((byte)GetTag()); switch(GetTag()) { case Tag.animationCompleted: if (animationCompleted == null) { throw new System.InvalidOperationException("Arrays in messages may not have null entries."); } animationCompleted.Pack(writer); break; default: break; } } public int Size { get { int result = 1; // tag = byte switch(GetTag()) { case Tag.animationCompleted: if (animationCompleted == null) { throw new System.InvalidOperationException("Messages may not have null members."); } result += animationCompleted.Size; break; default: // Just tag size break; } return result; } } public static bool operator ==(ActionCompletedUnion a, ActionCompletedUnion b) { if (System.Object.ReferenceEquals(a, null)) { return System.Object.ReferenceEquals(b, null); } return a.Equals(b); } public static bool operator !=(ActionCompletedUnion a, ActionCompletedUnion b) { return !(a == b); } public override bool Equals(System.Object obj) { return this.Equals(obj as ActionCompletedUnion); } public bool Equals(ActionCompletedUnion p) { if (System.Object.ReferenceEquals(p, null)) { return false; } return (_tag == p._tag && _state.Equals(p._state)); } public override int GetHashCode() { unchecked { int hash = 17; hash = hash * 23 + this._tag.GetHashCode(); hash = hash * 23 + this._state.GetHashCode(); return hash; } } } public enum RobotActionType : int { UNKNOWN = -1 }; [System.Flags] public enum ActionResult : uint { SUCCESS = 0, RUNNING = 16777216, CANCELLED_WHILE_RUNNING = 33554432 }; public enum ObjectFamily : int { Invalid = -1, Unknown = 0, Block = 1, LightCube = 2, Charger = 3, CustomObject = 6 }; public partial class ActiveAccel { private float _x; // float_32 private float _y; // float_32 private float _z; // float_32 public float x { get { return _x; } set { _x = value; } } public float y { get { return _y; } set { _y = value; } } public float z { get { return _z; } set { _z = value; } } /**** Constructors ****/ public ActiveAccel() { } public ActiveAccel(float x, float y, float z) { this.x = x; this.y = y; this.z = z; } public ActiveAccel(System.IO.Stream stream) { Unpack(stream); } public ActiveAccel(System.IO.BinaryReader reader) { Unpack(reader); } public ActiveAccel Initialize(float x, float y, float z) { this.x = x; this.y = y; this.z = z; return this; } public void Unpack(System.IO.Stream stream) { System.IO.BinaryReader reader = new System.IO.BinaryReader(stream); Unpack(reader); } public void Unpack(System.IO.BinaryReader reader) { _x = reader.ReadSingle(); _y = reader.ReadSingle(); _z = reader.ReadSingle(); } public void Pack(System.IO.Stream stream) { System.IO.BinaryWriter writer = new System.IO.BinaryWriter(stream); Pack(writer); } public void Pack(System.IO.BinaryWriter writer) { writer.Write((float)_x); writer.Write((float)_y); writer.Write((float)_z); } public int Size { get { return 12; } } public static bool ArrayEquals(System.Collections.Generic.IList a1, System.Collections.Generic.IList a2) { if (System.Object.ReferenceEquals(a1, a2)) return true; if (System.Object.ReferenceEquals(a1, null) || System.Object.ReferenceEquals(a2, null)) return false; if (a1.Count != a2.Count) return false; for (int i = 0; i < a1.Count; i++) { if (!a1[i].Equals(a2[i])) { return false; } } return true; } public static bool operator ==(ActiveAccel a, ActiveAccel b) { if (System.Object.ReferenceEquals(a, null)) { return System.Object.ReferenceEquals(b, null); } return a.Equals(b); } public static bool operator !=(ActiveAccel a, ActiveAccel b) { return !(a == b); } public override bool Equals(System.Object obj) { return this.Equals(obj as ActiveAccel); } public bool Equals(ActiveAccel p) { if (System.Object.ReferenceEquals(p, null)) { return false; } return this._x.Equals(p._x) && this._y.Equals(p._y) && this._z.Equals(p._z); } public override int GetHashCode() { unchecked { int hash = 17; hash = hash * 23 + this._x.GetHashCode(); hash = hash * 23 + this._y.GetHashCode(); hash = hash * 23 + this._z.GetHashCode(); return hash; } } } public enum UpAxis : byte { XNegative = 0, XPositive = 1, YNegative = 2, YPositive = 3, ZNegative = 4, ZPositive = 5, NumAxes = 6, UnknownAxis = 7 }; public partial class ObjectConnectionState { private uint _objectID; // uint_32 private string _factoryID; // string[uint_8] private Anki.Vector.Gateway.ObjectType _object_type; // ObjectType private bool _connected; // bool public uint objectID { get { return _objectID; } set { _objectID = value; } } public string factoryID { get { return _factoryID; } set { if (!string.IsNullOrEmpty(value) && System.Text.Encoding.UTF8.GetByteCount(value) > 255) { throw new System.ArgumentException("factoryID string is too long. Must decode to less than or equal to 255 bytes.", "value"); } _factoryID = value; } } public Anki.Vector.Gateway.ObjectType object_type { get { return _object_type; } set { _object_type = value; } } public bool connected { get { return _connected; } set { _connected = value; } } /**** Constructors ****/ public ObjectConnectionState() { } public ObjectConnectionState(uint objectID, string factoryID, Anki.Vector.Gateway.ObjectType object_type, bool connected) { this.objectID = objectID; this.factoryID = factoryID; this.object_type = object_type; this.connected = connected; } public ObjectConnectionState(System.IO.Stream stream) { Unpack(stream); } public ObjectConnectionState(System.IO.BinaryReader reader) { Unpack(reader); } public ObjectConnectionState Initialize(uint objectID, string factoryID, Anki.Vector.Gateway.ObjectType object_type, bool connected) { this.objectID = objectID; this.factoryID = factoryID; this.object_type = object_type; this.connected = connected; return this; } public void Unpack(System.IO.Stream stream) { System.IO.BinaryReader reader = new System.IO.BinaryReader(stream); Unpack(reader); } public void Unpack(System.IO.BinaryReader reader) { _objectID = reader.ReadUInt32(); int _factoryID_length = (int)reader.ReadByte(); byte[] _factoryID_bytes = reader.ReadBytes(_factoryID_length); _factoryID = System.Text.Encoding.UTF8.GetString(_factoryID_bytes); _object_type = (Anki.Vector.Gateway.ObjectType)reader.ReadInt32(); _connected = reader.ReadBoolean(); } public void Pack(System.IO.Stream stream) { System.IO.BinaryWriter writer = new System.IO.BinaryWriter(stream); Pack(writer); } public void Pack(System.IO.BinaryWriter writer) { writer.Write((uint)_objectID); if (_factoryID != null) { byte[] _factoryID_bytes = System.Text.Encoding.UTF8.GetBytes(_factoryID); writer.Write((byte)_factoryID_bytes.Length); writer.Write(_factoryID_bytes); } else { writer.Write((byte)0); } writer.Write((int)_object_type); writer.Write((bool)_connected); } public int Size { get { int result = 0; result += 4; // uint_32 result += 1; // uint_8 if (factoryID != null) { result += System.Text.Encoding.UTF8.GetByteCount(factoryID); } result += 4; // ObjectType result += 1; // bool return result; } } public static bool ArrayEquals(System.Collections.Generic.IList a1, System.Collections.Generic.IList a2) { if (System.Object.ReferenceEquals(a1, a2)) return true; if (System.Object.ReferenceEquals(a1, null) || System.Object.ReferenceEquals(a2, null)) return false; if (a1.Count != a2.Count) return false; for (int i = 0; i < a1.Count; i++) { if (!a1[i].Equals(a2[i])) { return false; } } return true; } public static bool operator ==(ObjectConnectionState a, ObjectConnectionState b) { if (System.Object.ReferenceEquals(a, null)) { return System.Object.ReferenceEquals(b, null); } return a.Equals(b); } public static bool operator !=(ObjectConnectionState a, ObjectConnectionState b) { return !(a == b); } public override bool Equals(System.Object obj) { return this.Equals(obj as ObjectConnectionState); } public bool Equals(ObjectConnectionState p) { if (System.Object.ReferenceEquals(p, null)) { return false; } return this._objectID.Equals(p._objectID) && this._factoryID.Equals(p._factoryID) && this._object_type.Equals(p._object_type) && this._connected.Equals(p._connected); } public override int GetHashCode() { unchecked { int hash = 17; hash = hash * 23 + this._objectID.GetHashCode(); hash = hash * 23 + this._object_type.GetHashCode(); hash = hash * 23 + this._connected.GetHashCode(); return hash; } } } public partial class ObjectMoved { private uint _timestamp; // uint_32 private uint _objectID; // uint_32 public uint timestamp { get { return _timestamp; } set { _timestamp = value; } } public uint objectID { get { return _objectID; } set { _objectID = value; } } /**** Constructors ****/ public ObjectMoved() { } public ObjectMoved(uint timestamp, uint objectID) { this.timestamp = timestamp; this.objectID = objectID; } public ObjectMoved(System.IO.Stream stream) { Unpack(stream); } public ObjectMoved(System.IO.BinaryReader reader) { Unpack(reader); } public ObjectMoved Initialize(uint timestamp, uint objectID) { this.timestamp = timestamp; this.objectID = objectID; return this; } public void Unpack(System.IO.Stream stream) { System.IO.BinaryReader reader = new System.IO.BinaryReader(stream); Unpack(reader); } public void Unpack(System.IO.BinaryReader reader) { _timestamp = reader.ReadUInt32(); _objectID = reader.ReadUInt32(); } public void Pack(System.IO.Stream stream) { System.IO.BinaryWriter writer = new System.IO.BinaryWriter(stream); Pack(writer); } public void Pack(System.IO.BinaryWriter writer) { writer.Write((uint)_timestamp); writer.Write((uint)_objectID); } public int Size { get { return 8; } } public static bool ArrayEquals(System.Collections.Generic.IList a1, System.Collections.Generic.IList a2) { if (System.Object.ReferenceEquals(a1, a2)) return true; if (System.Object.ReferenceEquals(a1, null) || System.Object.ReferenceEquals(a2, null)) return false; if (a1.Count != a2.Count) return false; for (int i = 0; i < a1.Count; i++) { if (!a1[i].Equals(a2[i])) { return false; } } return true; } public static bool operator ==(ObjectMoved a, ObjectMoved b) { if (System.Object.ReferenceEquals(a, null)) { return System.Object.ReferenceEquals(b, null); } return a.Equals(b); } public static bool operator !=(ObjectMoved a, ObjectMoved b) { return !(a == b); } public override bool Equals(System.Object obj) { return this.Equals(obj as ObjectMoved); } public bool Equals(ObjectMoved p) { if (System.Object.ReferenceEquals(p, null)) { return false; } return this._timestamp.Equals(p._timestamp) && this._objectID.Equals(p._objectID); } public override int GetHashCode() { unchecked { int hash = 17; hash = hash * 23 + this._timestamp.GetHashCode(); hash = hash * 23 + this._objectID.GetHashCode(); return hash; } } } public partial class ObjectAvailable { private string _factory_id; // string[uint_8] private Anki.Vector.Gateway.ObjectType _objectType; // ObjectType private sbyte _rssi; // int_8 public string factory_id { get { return _factory_id; } set { if (!string.IsNullOrEmpty(value) && System.Text.Encoding.UTF8.GetByteCount(value) > 255) { throw new System.ArgumentException("factory_id string is too long. Must decode to less than or equal to 255 bytes.", "value"); } _factory_id = value; } } public Anki.Vector.Gateway.ObjectType objectType { get { return _objectType; } set { _objectType = value; } } public sbyte rssi { get { return _rssi; } set { _rssi = value; } } /**** Constructors ****/ public ObjectAvailable() { } public ObjectAvailable(string factory_id, Anki.Vector.Gateway.ObjectType objectType, sbyte rssi) { this.factory_id = factory_id; this.objectType = objectType; this.rssi = rssi; } public ObjectAvailable(System.IO.Stream stream) { Unpack(stream); } public ObjectAvailable(System.IO.BinaryReader reader) { Unpack(reader); } public ObjectAvailable Initialize(string factory_id, Anki.Vector.Gateway.ObjectType objectType, sbyte rssi) { this.factory_id = factory_id; this.objectType = objectType; this.rssi = rssi; return this; } public void Unpack(System.IO.Stream stream) { System.IO.BinaryReader reader = new System.IO.BinaryReader(stream); Unpack(reader); } public void Unpack(System.IO.BinaryReader reader) { int _factory_id_length = (int)reader.ReadByte(); byte[] _factory_id_bytes = reader.ReadBytes(_factory_id_length); _factory_id = System.Text.Encoding.UTF8.GetString(_factory_id_bytes); _objectType = (Anki.Vector.Gateway.ObjectType)reader.ReadInt32(); _rssi = reader.ReadSByte(); } public void Pack(System.IO.Stream stream) { System.IO.BinaryWriter writer = new System.IO.BinaryWriter(stream); Pack(writer); } public void Pack(System.IO.BinaryWriter writer) { if (_factory_id != null) { byte[] _factory_id_bytes = System.Text.Encoding.UTF8.GetBytes(_factory_id); writer.Write((byte)_factory_id_bytes.Length); writer.Write(_factory_id_bytes); } else { writer.Write((byte)0); } writer.Write((int)_objectType); writer.Write((sbyte)_rssi); } public int Size { get { int result = 0; result += 1; // uint_8 if (factory_id != null) { result += System.Text.Encoding.UTF8.GetByteCount(factory_id); } result += 4; // ObjectType result += 1; // int_8 return result; } } public static bool ArrayEquals(System.Collections.Generic.IList a1, System.Collections.Generic.IList a2) { if (System.Object.ReferenceEquals(a1, a2)) return true; if (System.Object.ReferenceEquals(a1, null) || System.Object.ReferenceEquals(a2, null)) return false; if (a1.Count != a2.Count) return false; for (int i = 0; i < a1.Count; i++) { if (!a1[i].Equals(a2[i])) { return false; } } return true; } public static bool operator ==(ObjectAvailable a, ObjectAvailable b) { if (System.Object.ReferenceEquals(a, null)) { return System.Object.ReferenceEquals(b, null); } return a.Equals(b); } public static bool operator !=(ObjectAvailable a, ObjectAvailable b) { return !(a == b); } public override bool Equals(System.Object obj) { return this.Equals(obj as ObjectAvailable); } public bool Equals(ObjectAvailable p) { if (System.Object.ReferenceEquals(p, null)) { return false; } return this._factory_id.Equals(p._factory_id) && this._objectType.Equals(p._objectType) && this._rssi.Equals(p._rssi); } public override int GetHashCode() { unchecked { int hash = 17; hash = hash * 23 + this._objectType.GetHashCode(); hash = hash * 23 + this._rssi.GetHashCode(); return hash; } } } public partial class ObjectStoppedMoving { private uint _timestamp; // uint_32 private uint _objectID; // uint_32 public uint timestamp { get { return _timestamp; } set { _timestamp = value; } } public uint objectID { get { return _objectID; } set { _objectID = value; } } /**** Constructors ****/ public ObjectStoppedMoving() { } public ObjectStoppedMoving(uint timestamp, uint objectID) { this.timestamp = timestamp; this.objectID = objectID; } public ObjectStoppedMoving(System.IO.Stream stream) { Unpack(stream); } public ObjectStoppedMoving(System.IO.BinaryReader reader) { Unpack(reader); } public ObjectStoppedMoving Initialize(uint timestamp, uint objectID) { this.timestamp = timestamp; this.objectID = objectID; return this; } public void Unpack(System.IO.Stream stream) { System.IO.BinaryReader reader = new System.IO.BinaryReader(stream); Unpack(reader); } public void Unpack(System.IO.BinaryReader reader) { _timestamp = reader.ReadUInt32(); _objectID = reader.ReadUInt32(); } public void Pack(System.IO.Stream stream) { System.IO.BinaryWriter writer = new System.IO.BinaryWriter(stream); Pack(writer); } public void Pack(System.IO.BinaryWriter writer) { writer.Write((uint)_timestamp); writer.Write((uint)_objectID); } public int Size { get { return 8; } } public static bool ArrayEquals(System.Collections.Generic.IList a1, System.Collections.Generic.IList a2) { if (System.Object.ReferenceEquals(a1, a2)) return true; if (System.Object.ReferenceEquals(a1, null) || System.Object.ReferenceEquals(a2, null)) return false; if (a1.Count != a2.Count) return false; for (int i = 0; i < a1.Count; i++) { if (!a1[i].Equals(a2[i])) { return false; } } return true; } public static bool operator ==(ObjectStoppedMoving a, ObjectStoppedMoving b) { if (System.Object.ReferenceEquals(a, null)) { return System.Object.ReferenceEquals(b, null); } return a.Equals(b); } public static bool operator !=(ObjectStoppedMoving a, ObjectStoppedMoving b) { return !(a == b); } public override bool Equals(System.Object obj) { return this.Equals(obj as ObjectStoppedMoving); } public bool Equals(ObjectStoppedMoving p) { if (System.Object.ReferenceEquals(p, null)) { return false; } return this._timestamp.Equals(p._timestamp) && this._objectID.Equals(p._objectID); } public override int GetHashCode() { unchecked { int hash = 17; hash = hash * 23 + this._timestamp.GetHashCode(); hash = hash * 23 + this._objectID.GetHashCode(); return hash; } } } public partial class ObjectUpAxisChanged { private uint _timestamp; // uint_32 private uint _objectID; // uint_32 private Anki.Vector.Gateway.UpAxis _upAxis; // UpAxis public uint timestamp { get { return _timestamp; } set { _timestamp = value; } } public uint objectID { get { return _objectID; } set { _objectID = value; } } public Anki.Vector.Gateway.UpAxis upAxis { get { return _upAxis; } set { _upAxis = value; } } /**** Constructors ****/ public ObjectUpAxisChanged() { } public ObjectUpAxisChanged(uint timestamp, uint objectID, Anki.Vector.Gateway.UpAxis upAxis) { this.timestamp = timestamp; this.objectID = objectID; this.upAxis = upAxis; } public ObjectUpAxisChanged(System.IO.Stream stream) { Unpack(stream); } public ObjectUpAxisChanged(System.IO.BinaryReader reader) { Unpack(reader); } public ObjectUpAxisChanged Initialize(uint timestamp, uint objectID, Anki.Vector.Gateway.UpAxis upAxis) { this.timestamp = timestamp; this.objectID = objectID; this.upAxis = upAxis; return this; } public void Unpack(System.IO.Stream stream) { System.IO.BinaryReader reader = new System.IO.BinaryReader(stream); Unpack(reader); } public void Unpack(System.IO.BinaryReader reader) { _timestamp = reader.ReadUInt32(); _objectID = reader.ReadUInt32(); _upAxis = (Anki.Vector.Gateway.UpAxis)reader.ReadByte(); } public void Pack(System.IO.Stream stream) { System.IO.BinaryWriter writer = new System.IO.BinaryWriter(stream); Pack(writer); } public void Pack(System.IO.BinaryWriter writer) { writer.Write((uint)_timestamp); writer.Write((uint)_objectID); writer.Write((byte)_upAxis); } public int Size { get { return 9; } } public static bool ArrayEquals(System.Collections.Generic.IList a1, System.Collections.Generic.IList a2) { if (System.Object.ReferenceEquals(a1, a2)) return true; if (System.Object.ReferenceEquals(a1, null) || System.Object.ReferenceEquals(a2, null)) return false; if (a1.Count != a2.Count) return false; for (int i = 0; i < a1.Count; i++) { if (!a1[i].Equals(a2[i])) { return false; } } return true; } public static bool operator ==(ObjectUpAxisChanged a, ObjectUpAxisChanged b) { if (System.Object.ReferenceEquals(a, null)) { return System.Object.ReferenceEquals(b, null); } return a.Equals(b); } public static bool operator !=(ObjectUpAxisChanged a, ObjectUpAxisChanged b) { return !(a == b); } public override bool Equals(System.Object obj) { return this.Equals(obj as ObjectUpAxisChanged); } public bool Equals(ObjectUpAxisChanged p) { if (System.Object.ReferenceEquals(p, null)) { return false; } return this._timestamp.Equals(p._timestamp) && this._objectID.Equals(p._objectID) && this._upAxis.Equals(p._upAxis); } public override int GetHashCode() { unchecked { int hash = 17; hash = hash * 23 + this._timestamp.GetHashCode(); hash = hash * 23 + this._objectID.GetHashCode(); hash = hash * 23 + this._upAxis.GetHashCode(); return hash; } } } public partial class ObjectTapped { private uint _timestamp; // uint_32 private uint _objectID; // uint_32 public uint timestamp { get { return _timestamp; } set { _timestamp = value; } } public uint objectID { get { return _objectID; } set { _objectID = value; } } /**** Constructors ****/ public ObjectTapped() { } public ObjectTapped(uint timestamp, uint objectID) { this.timestamp = timestamp; this.objectID = objectID; } public ObjectTapped(System.IO.Stream stream) { Unpack(stream); } public ObjectTapped(System.IO.BinaryReader reader) { Unpack(reader); } public ObjectTapped Initialize(uint timestamp, uint objectID) { this.timestamp = timestamp; this.objectID = objectID; return this; } public void Unpack(System.IO.Stream stream) { System.IO.BinaryReader reader = new System.IO.BinaryReader(stream); Unpack(reader); } public void Unpack(System.IO.BinaryReader reader) { _timestamp = reader.ReadUInt32(); _objectID = reader.ReadUInt32(); } public void Pack(System.IO.Stream stream) { System.IO.BinaryWriter writer = new System.IO.BinaryWriter(stream); Pack(writer); } public void Pack(System.IO.BinaryWriter writer) { writer.Write((uint)_timestamp); writer.Write((uint)_objectID); } public int Size { get { return 8; } } public static bool ArrayEquals(System.Collections.Generic.IList a1, System.Collections.Generic.IList a2) { if (System.Object.ReferenceEquals(a1, a2)) return true; if (System.Object.ReferenceEquals(a1, null) || System.Object.ReferenceEquals(a2, null)) return false; if (a1.Count != a2.Count) return false; for (int i = 0; i < a1.Count; i++) { if (!a1[i].Equals(a2[i])) { return false; } } return true; } public static bool operator ==(ObjectTapped a, ObjectTapped b) { if (System.Object.ReferenceEquals(a, null)) { return System.Object.ReferenceEquals(b, null); } return a.Equals(b); } public static bool operator !=(ObjectTapped a, ObjectTapped b) { return !(a == b); } public override bool Equals(System.Object obj) { return this.Equals(obj as ObjectTapped); } public bool Equals(ObjectTapped p) { if (System.Object.ReferenceEquals(p, null)) { return false; } return this._timestamp.Equals(p._timestamp) && this._objectID.Equals(p._objectID); } public override int GetHashCode() { unchecked { int hash = 17; hash = hash * 23 + this._timestamp.GetHashCode(); hash = hash * 23 + this._objectID.GetHashCode(); return hash; } } } public partial class ObjectAccel { private uint _timestamp; // uint_32 private uint _objectID; // uint_32 private Anki.Vector.Gateway.ActiveAccel _accel; // ActiveAccel public uint timestamp { get { return _timestamp; } set { _timestamp = value; } } public uint objectID { get { return _objectID; } set { _objectID = value; } } public Anki.Vector.Gateway.ActiveAccel accel { get { return _accel; } set { if (value == null) { throw new System.ArgumentNullException("accel cannot be null.", "value"); } _accel = value; } } /**** Constructors ****/ public ObjectAccel() { this.accel = new Anki.Vector.Gateway.ActiveAccel(); } public ObjectAccel(uint timestamp, uint objectID, Anki.Vector.Gateway.ActiveAccel accel) { this.timestamp = timestamp; this.objectID = objectID; this.accel = accel; } public ObjectAccel(System.IO.Stream stream) { Unpack(stream); } public ObjectAccel(System.IO.BinaryReader reader) { Unpack(reader); } public ObjectAccel Initialize(uint timestamp, uint objectID, Anki.Vector.Gateway.ActiveAccel accel) { this.timestamp = timestamp; this.objectID = objectID; this.accel = accel; return this; } public void Unpack(System.IO.Stream stream) { System.IO.BinaryReader reader = new System.IO.BinaryReader(stream); Unpack(reader); } public void Unpack(System.IO.BinaryReader reader) { _timestamp = reader.ReadUInt32(); _objectID = reader.ReadUInt32(); _accel = new Anki.Vector.Gateway.ActiveAccel(reader); } public void Pack(System.IO.Stream stream) { System.IO.BinaryWriter writer = new System.IO.BinaryWriter(stream); Pack(writer); } public void Pack(System.IO.BinaryWriter writer) { writer.Write((uint)_timestamp); writer.Write((uint)_objectID); _accel.Pack(writer); } public int Size { get { return 20; } } public static bool ArrayEquals(System.Collections.Generic.IList a1, System.Collections.Generic.IList a2) { if (System.Object.ReferenceEquals(a1, a2)) return true; if (System.Object.ReferenceEquals(a1, null) || System.Object.ReferenceEquals(a2, null)) return false; if (a1.Count != a2.Count) return false; for (int i = 0; i < a1.Count; i++) { if (!a1[i].Equals(a2[i])) { return false; } } return true; } public static bool operator ==(ObjectAccel a, ObjectAccel b) { if (System.Object.ReferenceEquals(a, null)) { return System.Object.ReferenceEquals(b, null); } return a.Equals(b); } public static bool operator !=(ObjectAccel a, ObjectAccel b) { return !(a == b); } public override bool Equals(System.Object obj) { return this.Equals(obj as ObjectAccel); } public bool Equals(ObjectAccel p) { if (System.Object.ReferenceEquals(p, null)) { return false; } return this._timestamp.Equals(p._timestamp) && this._objectID.Equals(p._objectID) && this._accel.Equals(p._accel); } public override int GetHashCode() { unchecked { int hash = 17; hash = hash * 23 + this._timestamp.GetHashCode(); hash = hash * 23 + this._objectID.GetHashCode(); hash = hash * 23 + this._accel.GetHashCode(); return hash; } } } public partial class RobotCompletedAction { private uint _idTag; // uint_32 private Anki.Vector.Gateway.RobotActionType _actionType; // RobotActionType private Anki.Vector.Gateway.ActionResult _result; // ActionResult private Anki.Vector.Gateway.ActionResult[] _subActionResults; // ActionResult[uint_8] private Anki.Vector.Gateway.ActionCompletedUnion _completionInfo; // ActionCompletedUnion public uint idTag { get { return _idTag; } set { _idTag = value; } } public Anki.Vector.Gateway.RobotActionType actionType { get { return _actionType; } set { _actionType = value; } } public Anki.Vector.Gateway.ActionResult result { get { return _result; } set { _result = value; } } public Anki.Vector.Gateway.ActionResult[] subActionResults { get { return _subActionResults; } set { if (value != null && value.Length > 255) { throw new System.ArgumentException("subActionResults variable-length array is too long. Must be less than or equal to 255.", "value"); } _subActionResults = value; } } public Anki.Vector.Gateway.ActionCompletedUnion completionInfo { get { return _completionInfo; } set { if (value == null) { throw new System.ArgumentNullException("completionInfo cannot be null.", "value"); } _completionInfo = value; } } /**** Constructors ****/ public RobotCompletedAction() { this.completionInfo = new Anki.Vector.Gateway.ActionCompletedUnion(); } public RobotCompletedAction(uint idTag, Anki.Vector.Gateway.RobotActionType actionType, Anki.Vector.Gateway.ActionResult result, Anki.Vector.Gateway.ActionResult[] subActionResults, Anki.Vector.Gateway.ActionCompletedUnion completionInfo) { this.idTag = idTag; this.actionType = actionType; this.result = result; this.subActionResults = subActionResults; this.completionInfo = completionInfo; } public RobotCompletedAction(System.IO.Stream stream) { Unpack(stream); } public RobotCompletedAction(System.IO.BinaryReader reader) { Unpack(reader); } public RobotCompletedAction Initialize(uint idTag, Anki.Vector.Gateway.RobotActionType actionType, Anki.Vector.Gateway.ActionResult result, Anki.Vector.Gateway.ActionResult[] subActionResults, Anki.Vector.Gateway.ActionCompletedUnion completionInfo) { this.idTag = idTag; this.actionType = actionType; this.result = result; this.subActionResults = subActionResults; this.completionInfo = completionInfo; return this; } public RobotCompletedAction Initialize(uint idTag, Anki.Vector.Gateway.RobotActionType actionType, Anki.Vector.Gateway.ActionResult result, Anki.Vector.Gateway.ActionResult[] subActionResults, T0 completionInfoState) { this.idTag = idTag; this.actionType = actionType; this.result = result; this.subActionResults = subActionResults; this.completionInfo.Initialize(completionInfoState); return this; } public void Unpack(System.IO.Stream stream) { System.IO.BinaryReader reader = new System.IO.BinaryReader(stream); Unpack(reader); } public void Unpack(System.IO.BinaryReader reader) { _idTag = reader.ReadUInt32(); _actionType = (Anki.Vector.Gateway.RobotActionType)reader.ReadInt32(); _result = (Anki.Vector.Gateway.ActionResult)reader.ReadUInt32(); int _subActionResults_length = (int)reader.ReadByte(); _subActionResults = new Anki.Vector.Gateway.ActionResult[_subActionResults_length]; for (int i = 0; i < _subActionResults_length; ++i) { _subActionResults[i] = (Anki.Vector.Gateway.ActionResult)reader.ReadUInt32(); } _completionInfo = new Anki.Vector.Gateway.ActionCompletedUnion(reader); } public void Pack(System.IO.Stream stream) { System.IO.BinaryWriter writer = new System.IO.BinaryWriter(stream); Pack(writer); } public void Pack(System.IO.BinaryWriter writer) { writer.Write((uint)_idTag); writer.Write((int)_actionType); writer.Write((uint)_result); if (_subActionResults != null) { writer.Write((byte)_subActionResults.Length); for (int i = 0; i < _subActionResults.Length; ++i) { writer.Write((uint)_subActionResults[i]); } } else { writer.Write((byte)0); } _completionInfo.Pack(writer); } public int Size { get { int result = 0; result += 4; // uint_32 result += 4; // RobotActionType result += 4; // ActionResult result += 1; // uint_8 if (subActionResults != null) { result += subActionResults.Length * 4; // ActionResult } result += completionInfo.Size; return result; } } public static bool ArrayEquals(System.Collections.Generic.IList a1, System.Collections.Generic.IList a2) { if (System.Object.ReferenceEquals(a1, a2)) return true; if (System.Object.ReferenceEquals(a1, null) || System.Object.ReferenceEquals(a2, null)) return false; if (a1.Count != a2.Count) return false; for (int i = 0; i < a1.Count; i++) { if (!a1[i].Equals(a2[i])) { return false; } } return true; } public static bool operator ==(RobotCompletedAction a, RobotCompletedAction b) { if (System.Object.ReferenceEquals(a, null)) { return System.Object.ReferenceEquals(b, null); } return a.Equals(b); } public static bool operator !=(RobotCompletedAction a, RobotCompletedAction b) { return !(a == b); } public override bool Equals(System.Object obj) { return this.Equals(obj as RobotCompletedAction); } public bool Equals(RobotCompletedAction p) { if (System.Object.ReferenceEquals(p, null)) { return false; } return this._idTag.Equals(p._idTag) && this._actionType.Equals(p._actionType) && this._result.Equals(p._result) && ArrayEquals(this._subActionResults,p._subActionResults) && this._completionInfo.Equals(p._completionInfo); } public override int GetHashCode() { unchecked { int hash = 17; hash = hash * 23 + this._idTag.GetHashCode(); hash = hash * 23 + this._actionType.GetHashCode(); hash = hash * 23 + this._result.GetHashCode(); hash = hash * 23 + this._completionInfo.GetHashCode(); return hash; } } } public partial class LoadedKnownFace { private long _secondsSinceFirstEnrolled; // int_64 private long _secondsSinceLastUpdated; // int_64 private long _secondsSinceLastSeen; // int_64 private long _lastSeenSecondsSinceEpoch; // int_64 private int _faceID; // int_32 private string _name; // string[uint_8] public long secondsSinceFirstEnrolled { get { return _secondsSinceFirstEnrolled; } set { _secondsSinceFirstEnrolled = value; } } public long secondsSinceLastUpdated { get { return _secondsSinceLastUpdated; } set { _secondsSinceLastUpdated = value; } } public long secondsSinceLastSeen { get { return _secondsSinceLastSeen; } set { _secondsSinceLastSeen = value; } } public long lastSeenSecondsSinceEpoch { get { return _lastSeenSecondsSinceEpoch; } set { _lastSeenSecondsSinceEpoch = value; } } public int faceID { get { return _faceID; } set { _faceID = value; } } public string name { get { return _name; } set { if (!string.IsNullOrEmpty(value) && System.Text.Encoding.UTF8.GetByteCount(value) > 255) { throw new System.ArgumentException("name string is too long. Must decode to less than or equal to 255 bytes.", "value"); } _name = value; } } /**** Constructors ****/ public LoadedKnownFace() { } public LoadedKnownFace(long secondsSinceFirstEnrolled, long secondsSinceLastUpdated, long secondsSinceLastSeen, long lastSeenSecondsSinceEpoch, int faceID, string name) { this.secondsSinceFirstEnrolled = secondsSinceFirstEnrolled; this.secondsSinceLastUpdated = secondsSinceLastUpdated; this.secondsSinceLastSeen = secondsSinceLastSeen; this.lastSeenSecondsSinceEpoch = lastSeenSecondsSinceEpoch; this.faceID = faceID; this.name = name; } public LoadedKnownFace(System.IO.Stream stream) { Unpack(stream); } public LoadedKnownFace(System.IO.BinaryReader reader) { Unpack(reader); } public LoadedKnownFace Initialize(long secondsSinceFirstEnrolled, long secondsSinceLastUpdated, long secondsSinceLastSeen, long lastSeenSecondsSinceEpoch, int faceID, string name) { this.secondsSinceFirstEnrolled = secondsSinceFirstEnrolled; this.secondsSinceLastUpdated = secondsSinceLastUpdated; this.secondsSinceLastSeen = secondsSinceLastSeen; this.lastSeenSecondsSinceEpoch = lastSeenSecondsSinceEpoch; this.faceID = faceID; this.name = name; return this; } public void Unpack(System.IO.Stream stream) { System.IO.BinaryReader reader = new System.IO.BinaryReader(stream); Unpack(reader); } public void Unpack(System.IO.BinaryReader reader) { _secondsSinceFirstEnrolled = reader.ReadInt64(); _secondsSinceLastUpdated = reader.ReadInt64(); _secondsSinceLastSeen = reader.ReadInt64(); _lastSeenSecondsSinceEpoch = reader.ReadInt64(); _faceID = reader.ReadInt32(); int _name_length = (int)reader.ReadByte(); byte[] _name_bytes = reader.ReadBytes(_name_length); _name = System.Text.Encoding.UTF8.GetString(_name_bytes); } public void Pack(System.IO.Stream stream) { System.IO.BinaryWriter writer = new System.IO.BinaryWriter(stream); Pack(writer); } public void Pack(System.IO.BinaryWriter writer) { writer.Write((long)_secondsSinceFirstEnrolled); writer.Write((long)_secondsSinceLastUpdated); writer.Write((long)_secondsSinceLastSeen); writer.Write((long)_lastSeenSecondsSinceEpoch); writer.Write((int)_faceID); if (_name != null) { byte[] _name_bytes = System.Text.Encoding.UTF8.GetBytes(_name); writer.Write((byte)_name_bytes.Length); writer.Write(_name_bytes); } else { writer.Write((byte)0); } } public int Size { get { int result = 0; result += 8; // int_64 result += 8; // int_64 result += 8; // int_64 result += 8; // int_64 result += 4; // int_32 result += 1; // uint_8 if (name != null) { result += System.Text.Encoding.UTF8.GetByteCount(name); } return result; } } public static bool ArrayEquals(System.Collections.Generic.IList a1, System.Collections.Generic.IList a2) { if (System.Object.ReferenceEquals(a1, a2)) return true; if (System.Object.ReferenceEquals(a1, null) || System.Object.ReferenceEquals(a2, null)) return false; if (a1.Count != a2.Count) return false; for (int i = 0; i < a1.Count; i++) { if (!a1[i].Equals(a2[i])) { return false; } } return true; } public static bool operator ==(LoadedKnownFace a, LoadedKnownFace b) { if (System.Object.ReferenceEquals(a, null)) { return System.Object.ReferenceEquals(b, null); } return a.Equals(b); } public static bool operator !=(LoadedKnownFace a, LoadedKnownFace b) { return !(a == b); } public override bool Equals(System.Object obj) { return this.Equals(obj as LoadedKnownFace); } public bool Equals(LoadedKnownFace p) { if (System.Object.ReferenceEquals(p, null)) { return false; } return this._secondsSinceFirstEnrolled.Equals(p._secondsSinceFirstEnrolled) && this._secondsSinceLastUpdated.Equals(p._secondsSinceLastUpdated) && this._secondsSinceLastSeen.Equals(p._secondsSinceLastSeen) && this._lastSeenSecondsSinceEpoch.Equals(p._lastSeenSecondsSinceEpoch) && this._faceID.Equals(p._faceID) && this._name.Equals(p._name); } public override int GetHashCode() { unchecked { int hash = 17; hash = hash * 23 + this._secondsSinceFirstEnrolled.GetHashCode(); hash = hash * 23 + this._secondsSinceLastUpdated.GetHashCode(); hash = hash * 23 + this._secondsSinceLastSeen.GetHashCode(); hash = hash * 23 + this._lastSeenSecondsSinceEpoch.GetHashCode(); hash = hash * 23 + this._faceID.GetHashCode(); return hash; } } } public partial class EnrolledNamesResponse { private Anki.Vector.Gateway.LoadedKnownFace[] _faces; // LoadedKnownFace[uint_8] public Anki.Vector.Gateway.LoadedKnownFace[] faces { get { return _faces; } set { if (value != null && value.Length > 255) { throw new System.ArgumentException("faces variable-length array is too long. Must be less than or equal to 255.", "value"); } _faces = value; } } /**** Constructors ****/ public EnrolledNamesResponse() { } public EnrolledNamesResponse(Anki.Vector.Gateway.LoadedKnownFace[] faces) { this.faces = faces; } public EnrolledNamesResponse(System.IO.Stream stream) { Unpack(stream); } public EnrolledNamesResponse(System.IO.BinaryReader reader) { Unpack(reader); } public EnrolledNamesResponse Initialize(Anki.Vector.Gateway.LoadedKnownFace[] faces) { this.faces = faces; return this; } public void Unpack(System.IO.Stream stream) { System.IO.BinaryReader reader = new System.IO.BinaryReader(stream); Unpack(reader); } public void Unpack(System.IO.BinaryReader reader) { int _faces_length = (int)reader.ReadByte(); _faces = new Anki.Vector.Gateway.LoadedKnownFace[_faces_length]; for (int i = 0; i < _faces_length; ++i) { _faces[i] = new Anki.Vector.Gateway.LoadedKnownFace(reader); } } public void Pack(System.IO.Stream stream) { System.IO.BinaryWriter writer = new System.IO.BinaryWriter(stream); Pack(writer); } public void Pack(System.IO.BinaryWriter writer) { if (_faces != null) { writer.Write((byte)_faces.Length); for (int i = 0; i < _faces.Length; ++i) { if (_faces[i] == null) { throw new System.InvalidOperationException("Arrays in messages may not have null entries."); } _faces[i].Pack(writer); } } else { writer.Write((byte)0); } } public int Size { get { int result = 0; result += 1; // uint_8 if (faces != null) { for (int i = 0; i < faces.Length; ++i) { if (faces[i] == null) { throw new System.InvalidOperationException("Messages may not have null members."); } result += faces[i].Size; } } return result; } } public static bool ArrayEquals(System.Collections.Generic.IList a1, System.Collections.Generic.IList a2) { if (System.Object.ReferenceEquals(a1, a2)) return true; if (System.Object.ReferenceEquals(a1, null) || System.Object.ReferenceEquals(a2, null)) return false; if (a1.Count != a2.Count) return false; for (int i = 0; i < a1.Count; i++) { if (!a1[i].Equals(a2[i])) { return false; } } return true; } public static bool operator ==(EnrolledNamesResponse a, EnrolledNamesResponse b) { if (System.Object.ReferenceEquals(a, null)) { return System.Object.ReferenceEquals(b, null); } return a.Equals(b); } public static bool operator !=(EnrolledNamesResponse a, EnrolledNamesResponse b) { return !(a == b); } public override bool Equals(System.Object obj) { return this.Equals(obj as EnrolledNamesResponse); } public bool Equals(EnrolledNamesResponse p) { if (System.Object.ReferenceEquals(p, null)) { return false; } return ArrayEquals(this._faces,p._faces); } public override int GetHashCode() { unchecked { int hash = 17; return hash; } } } public partial class AccelData { private float _x; // float_32 private float _y; // float_32 private float _z; // float_32 public float x { get { return _x; } set { _x = value; } } public float y { get { return _y; } set { _y = value; } } public float z { get { return _z; } set { _z = value; } } /**** Constructors ****/ public AccelData() { } public AccelData(float x, float y, float z) { this.x = x; this.y = y; this.z = z; } public AccelData(System.IO.Stream stream) { Unpack(stream); } public AccelData(System.IO.BinaryReader reader) { Unpack(reader); } public AccelData Initialize(float x, float y, float z) { this.x = x; this.y = y; this.z = z; return this; } public void Unpack(System.IO.Stream stream) { System.IO.BinaryReader reader = new System.IO.BinaryReader(stream); Unpack(reader); } public void Unpack(System.IO.BinaryReader reader) { _x = reader.ReadSingle(); _y = reader.ReadSingle(); _z = reader.ReadSingle(); } public void Pack(System.IO.Stream stream) { System.IO.BinaryWriter writer = new System.IO.BinaryWriter(stream); Pack(writer); } public void Pack(System.IO.BinaryWriter writer) { writer.Write((float)_x); writer.Write((float)_y); writer.Write((float)_z); } public int Size { get { return 12; } } public static bool ArrayEquals(System.Collections.Generic.IList a1, System.Collections.Generic.IList a2) { if (System.Object.ReferenceEquals(a1, a2)) return true; if (System.Object.ReferenceEquals(a1, null) || System.Object.ReferenceEquals(a2, null)) return false; if (a1.Count != a2.Count) return false; for (int i = 0; i < a1.Count; i++) { if (!a1[i].Equals(a2[i])) { return false; } } return true; } public static bool operator ==(AccelData a, AccelData b) { if (System.Object.ReferenceEquals(a, null)) { return System.Object.ReferenceEquals(b, null); } return a.Equals(b); } public static bool operator !=(AccelData a, AccelData b) { return !(a == b); } public override bool Equals(System.Object obj) { return this.Equals(obj as AccelData); } public bool Equals(AccelData p) { if (System.Object.ReferenceEquals(p, null)) { return false; } return this._x.Equals(p._x) && this._y.Equals(p._y) && this._z.Equals(p._z); } public override int GetHashCode() { unchecked { int hash = 17; hash = hash * 23 + this._x.GetHashCode(); hash = hash * 23 + this._y.GetHashCode(); hash = hash * 23 + this._z.GetHashCode(); return hash; } } } public partial class GyroData { private float _x; // float_32 private float _y; // float_32 private float _z; // float_32 public float x { get { return _x; } set { _x = value; } } public float y { get { return _y; } set { _y = value; } } public float z { get { return _z; } set { _z = value; } } /**** Constructors ****/ public GyroData() { } public GyroData(float x, float y, float z) { this.x = x; this.y = y; this.z = z; } public GyroData(System.IO.Stream stream) { Unpack(stream); } public GyroData(System.IO.BinaryReader reader) { Unpack(reader); } public GyroData Initialize(float x, float y, float z) { this.x = x; this.y = y; this.z = z; return this; } public void Unpack(System.IO.Stream stream) { System.IO.BinaryReader reader = new System.IO.BinaryReader(stream); Unpack(reader); } public void Unpack(System.IO.BinaryReader reader) { _x = reader.ReadSingle(); _y = reader.ReadSingle(); _z = reader.ReadSingle(); } public void Pack(System.IO.Stream stream) { System.IO.BinaryWriter writer = new System.IO.BinaryWriter(stream); Pack(writer); } public void Pack(System.IO.BinaryWriter writer) { writer.Write((float)_x); writer.Write((float)_y); writer.Write((float)_z); } public int Size { get { return 12; } } public static bool ArrayEquals(System.Collections.Generic.IList a1, System.Collections.Generic.IList a2) { if (System.Object.ReferenceEquals(a1, a2)) return true; if (System.Object.ReferenceEquals(a1, null) || System.Object.ReferenceEquals(a2, null)) return false; if (a1.Count != a2.Count) return false; for (int i = 0; i < a1.Count; i++) { if (!a1[i].Equals(a2[i])) { return false; } } return true; } public static bool operator ==(GyroData a, GyroData b) { if (System.Object.ReferenceEquals(a, null)) { return System.Object.ReferenceEquals(b, null); } return a.Equals(b); } public static bool operator !=(GyroData a, GyroData b) { return !(a == b); } public override bool Equals(System.Object obj) { return this.Equals(obj as GyroData); } public bool Equals(GyroData p) { if (System.Object.ReferenceEquals(p, null)) { return false; } return this._x.Equals(p._x) && this._y.Equals(p._y) && this._z.Equals(p._z); } public override int GetHashCode() { unchecked { int hash = 17; hash = hash * 23 + this._x.GetHashCode(); hash = hash * 23 + this._y.GetHashCode(); hash = hash * 23 + this._z.GetHashCode(); return hash; } } } public partial class CladPoint2d { private float _x; // float_32 private float _y; // float_32 public float x { get { return _x; } set { _x = value; } } public float y { get { return _y; } set { _y = value; } } /**** Constructors ****/ public CladPoint2d() { } public CladPoint2d(float x, float y) { this.x = x; this.y = y; } public CladPoint2d(System.IO.Stream stream) { Unpack(stream); } public CladPoint2d(System.IO.BinaryReader reader) { Unpack(reader); } public CladPoint2d Initialize(float x, float y) { this.x = x; this.y = y; return this; } public void Unpack(System.IO.Stream stream) { System.IO.BinaryReader reader = new System.IO.BinaryReader(stream); Unpack(reader); } public void Unpack(System.IO.BinaryReader reader) { _x = reader.ReadSingle(); _y = reader.ReadSingle(); } public void Pack(System.IO.Stream stream) { System.IO.BinaryWriter writer = new System.IO.BinaryWriter(stream); Pack(writer); } public void Pack(System.IO.BinaryWriter writer) { writer.Write((float)_x); writer.Write((float)_y); } public int Size { get { return 8; } } public static bool ArrayEquals(System.Collections.Generic.IList a1, System.Collections.Generic.IList a2) { if (System.Object.ReferenceEquals(a1, a2)) return true; if (System.Object.ReferenceEquals(a1, null) || System.Object.ReferenceEquals(a2, null)) return false; if (a1.Count != a2.Count) return false; for (int i = 0; i < a1.Count; i++) { if (!a1[i].Equals(a2[i])) { return false; } } return true; } public static bool operator ==(CladPoint2d a, CladPoint2d b) { if (System.Object.ReferenceEquals(a, null)) { return System.Object.ReferenceEquals(b, null); } return a.Equals(b); } public static bool operator !=(CladPoint2d a, CladPoint2d b) { return !(a == b); } public override bool Equals(System.Object obj) { return this.Equals(obj as CladPoint2d); } public bool Equals(CladPoint2d p) { if (System.Object.ReferenceEquals(p, null)) { return false; } return this._x.Equals(p._x) && this._y.Equals(p._y); } public override int GetHashCode() { unchecked { int hash = 17; hash = hash * 23 + this._x.GetHashCode(); hash = hash * 23 + this._y.GetHashCode(); return hash; } } } public partial class CladRect { private float _x_topLeft; // float_32 private float _y_topLeft; // float_32 private float _width; // float_32 private float _height; // float_32 public float x_topLeft { get { return _x_topLeft; } set { _x_topLeft = value; } } public float y_topLeft { get { return _y_topLeft; } set { _y_topLeft = value; } } public float width { get { return _width; } set { _width = value; } } public float height { get { return _height; } set { _height = value; } } /**** Constructors ****/ public CladRect() { } public CladRect(float x_topLeft, float y_topLeft, float width, float height) { this.x_topLeft = x_topLeft; this.y_topLeft = y_topLeft; this.width = width; this.height = height; } public CladRect(System.IO.Stream stream) { Unpack(stream); } public CladRect(System.IO.BinaryReader reader) { Unpack(reader); } public CladRect Initialize(float x_topLeft, float y_topLeft, float width, float height) { this.x_topLeft = x_topLeft; this.y_topLeft = y_topLeft; this.width = width; this.height = height; return this; } public void Unpack(System.IO.Stream stream) { System.IO.BinaryReader reader = new System.IO.BinaryReader(stream); Unpack(reader); } public void Unpack(System.IO.BinaryReader reader) { _x_topLeft = reader.ReadSingle(); _y_topLeft = reader.ReadSingle(); _width = reader.ReadSingle(); _height = reader.ReadSingle(); } public void Pack(System.IO.Stream stream) { System.IO.BinaryWriter writer = new System.IO.BinaryWriter(stream); Pack(writer); } public void Pack(System.IO.BinaryWriter writer) { writer.Write((float)_x_topLeft); writer.Write((float)_y_topLeft); writer.Write((float)_width); writer.Write((float)_height); } public int Size { get { return 16; } } public static bool ArrayEquals(System.Collections.Generic.IList a1, System.Collections.Generic.IList a2) { if (System.Object.ReferenceEquals(a1, a2)) return true; if (System.Object.ReferenceEquals(a1, null) || System.Object.ReferenceEquals(a2, null)) return false; if (a1.Count != a2.Count) return false; for (int i = 0; i < a1.Count; i++) { if (!a1[i].Equals(a2[i])) { return false; } } return true; } public static bool operator ==(CladRect a, CladRect b) { if (System.Object.ReferenceEquals(a, null)) { return System.Object.ReferenceEquals(b, null); } return a.Equals(b); } public static bool operator !=(CladRect a, CladRect b) { return !(a == b); } public override bool Equals(System.Object obj) { return this.Equals(obj as CladRect); } public bool Equals(CladRect p) { if (System.Object.ReferenceEquals(p, null)) { return false; } return this._x_topLeft.Equals(p._x_topLeft) && this._y_topLeft.Equals(p._y_topLeft) && this._width.Equals(p._width) && this._height.Equals(p._height); } public override int GetHashCode() { unchecked { int hash = 17; hash = hash * 23 + this._x_topLeft.GetHashCode(); hash = hash * 23 + this._y_topLeft.GetHashCode(); hash = hash * 23 + this._width.GetHashCode(); hash = hash * 23 + this._height.GetHashCode(); return hash; } } } public enum FacialExpression : sbyte { Unknown = -1, Neutral = 0, Happiness = 1, Surprise = 2, Anger = 3, Sadness = 4, Count = 5 }; public partial class SmileAmount { private bool _wasChecked; // bool private float _amount; // float_32 private float _confidence; // float_32 public bool wasChecked { get { return _wasChecked; } set { _wasChecked = value; } } public float amount { get { return _amount; } set { _amount = value; } } public float confidence { get { return _confidence; } set { _confidence = value; } } /**** Constructors ****/ public SmileAmount() { } public SmileAmount(bool wasChecked, float amount, float confidence) { this.wasChecked = wasChecked; this.amount = amount; this.confidence = confidence; } public SmileAmount(System.IO.Stream stream) { Unpack(stream); } public SmileAmount(System.IO.BinaryReader reader) { Unpack(reader); } public SmileAmount Initialize(bool wasChecked, float amount, float confidence) { this.wasChecked = wasChecked; this.amount = amount; this.confidence = confidence; return this; } public void Unpack(System.IO.Stream stream) { System.IO.BinaryReader reader = new System.IO.BinaryReader(stream); Unpack(reader); } public void Unpack(System.IO.BinaryReader reader) { _wasChecked = reader.ReadBoolean(); _amount = reader.ReadSingle(); _confidence = reader.ReadSingle(); } public void Pack(System.IO.Stream stream) { System.IO.BinaryWriter writer = new System.IO.BinaryWriter(stream); Pack(writer); } public void Pack(System.IO.BinaryWriter writer) { writer.Write((bool)_wasChecked); writer.Write((float)_amount); writer.Write((float)_confidence); } public int Size { get { return 9; } } public static bool ArrayEquals(System.Collections.Generic.IList a1, System.Collections.Generic.IList a2) { if (System.Object.ReferenceEquals(a1, a2)) return true; if (System.Object.ReferenceEquals(a1, null) || System.Object.ReferenceEquals(a2, null)) return false; if (a1.Count != a2.Count) return false; for (int i = 0; i < a1.Count; i++) { if (!a1[i].Equals(a2[i])) { return false; } } return true; } public static bool operator ==(SmileAmount a, SmileAmount b) { if (System.Object.ReferenceEquals(a, null)) { return System.Object.ReferenceEquals(b, null); } return a.Equals(b); } public static bool operator !=(SmileAmount a, SmileAmount b) { return !(a == b); } public override bool Equals(System.Object obj) { return this.Equals(obj as SmileAmount); } public bool Equals(SmileAmount p) { if (System.Object.ReferenceEquals(p, null)) { return false; } return this._wasChecked.Equals(p._wasChecked) && this._amount.Equals(p._amount) && this._confidence.Equals(p._confidence); } public override int GetHashCode() { unchecked { int hash = 17; hash = hash * 23 + this._wasChecked.GetHashCode(); hash = hash * 23 + this._amount.GetHashCode(); hash = hash * 23 + this._confidence.GetHashCode(); return hash; } } } public partial class Gaze { private bool _wasChecked; // bool private float _leftRight_deg; // float_32 private float _upDown_deg; // float_32 public bool wasChecked { get { return _wasChecked; } set { _wasChecked = value; } } public float leftRight_deg { get { return _leftRight_deg; } set { _leftRight_deg = value; } } public float upDown_deg { get { return _upDown_deg; } set { _upDown_deg = value; } } /**** Constructors ****/ public Gaze() { } public Gaze(bool wasChecked, float leftRight_deg, float upDown_deg) { this.wasChecked = wasChecked; this.leftRight_deg = leftRight_deg; this.upDown_deg = upDown_deg; } public Gaze(System.IO.Stream stream) { Unpack(stream); } public Gaze(System.IO.BinaryReader reader) { Unpack(reader); } public Gaze Initialize(bool wasChecked, float leftRight_deg, float upDown_deg) { this.wasChecked = wasChecked; this.leftRight_deg = leftRight_deg; this.upDown_deg = upDown_deg; return this; } public void Unpack(System.IO.Stream stream) { System.IO.BinaryReader reader = new System.IO.BinaryReader(stream); Unpack(reader); } public void Unpack(System.IO.BinaryReader reader) { _wasChecked = reader.ReadBoolean(); _leftRight_deg = reader.ReadSingle(); _upDown_deg = reader.ReadSingle(); } public void Pack(System.IO.Stream stream) { System.IO.BinaryWriter writer = new System.IO.BinaryWriter(stream); Pack(writer); } public void Pack(System.IO.BinaryWriter writer) { writer.Write((bool)_wasChecked); writer.Write((float)_leftRight_deg); writer.Write((float)_upDown_deg); } public int Size { get { return 9; } } public static bool ArrayEquals(System.Collections.Generic.IList a1, System.Collections.Generic.IList a2) { if (System.Object.ReferenceEquals(a1, a2)) return true; if (System.Object.ReferenceEquals(a1, null) || System.Object.ReferenceEquals(a2, null)) return false; if (a1.Count != a2.Count) return false; for (int i = 0; i < a1.Count; i++) { if (!a1[i].Equals(a2[i])) { return false; } } return true; } public static bool operator ==(Gaze a, Gaze b) { if (System.Object.ReferenceEquals(a, null)) { return System.Object.ReferenceEquals(b, null); } return a.Equals(b); } public static bool operator !=(Gaze a, Gaze b) { return !(a == b); } public override bool Equals(System.Object obj) { return this.Equals(obj as Gaze); } public bool Equals(Gaze p) { if (System.Object.ReferenceEquals(p, null)) { return false; } return this._wasChecked.Equals(p._wasChecked) && this._leftRight_deg.Equals(p._leftRight_deg) && this._upDown_deg.Equals(p._upDown_deg); } public override int GetHashCode() { unchecked { int hash = 17; hash = hash * 23 + this._wasChecked.GetHashCode(); hash = hash * 23 + this._leftRight_deg.GetHashCode(); hash = hash * 23 + this._upDown_deg.GetHashCode(); return hash; } } } public partial class BlinkAmount { private bool _wasChecked; // bool private float _blinkAmountLeft; // float_32 private float _blinkAmountRight; // float_32 public bool wasChecked { get { return _wasChecked; } set { _wasChecked = value; } } public float blinkAmountLeft { get { return _blinkAmountLeft; } set { _blinkAmountLeft = value; } } public float blinkAmountRight { get { return _blinkAmountRight; } set { _blinkAmountRight = value; } } /**** Constructors ****/ public BlinkAmount() { } public BlinkAmount(bool wasChecked, float blinkAmountLeft, float blinkAmountRight) { this.wasChecked = wasChecked; this.blinkAmountLeft = blinkAmountLeft; this.blinkAmountRight = blinkAmountRight; } public BlinkAmount(System.IO.Stream stream) { Unpack(stream); } public BlinkAmount(System.IO.BinaryReader reader) { Unpack(reader); } public BlinkAmount Initialize(bool wasChecked, float blinkAmountLeft, float blinkAmountRight) { this.wasChecked = wasChecked; this.blinkAmountLeft = blinkAmountLeft; this.blinkAmountRight = blinkAmountRight; return this; } public void Unpack(System.IO.Stream stream) { System.IO.BinaryReader reader = new System.IO.BinaryReader(stream); Unpack(reader); } public void Unpack(System.IO.BinaryReader reader) { _wasChecked = reader.ReadBoolean(); _blinkAmountLeft = reader.ReadSingle(); _blinkAmountRight = reader.ReadSingle(); } public void Pack(System.IO.Stream stream) { System.IO.BinaryWriter writer = new System.IO.BinaryWriter(stream); Pack(writer); } public void Pack(System.IO.BinaryWriter writer) { writer.Write((bool)_wasChecked); writer.Write((float)_blinkAmountLeft); writer.Write((float)_blinkAmountRight); } public int Size { get { return 9; } } public static bool ArrayEquals(System.Collections.Generic.IList a1, System.Collections.Generic.IList a2) { if (System.Object.ReferenceEquals(a1, a2)) return true; if (System.Object.ReferenceEquals(a1, null) || System.Object.ReferenceEquals(a2, null)) return false; if (a1.Count != a2.Count) return false; for (int i = 0; i < a1.Count; i++) { if (!a1[i].Equals(a2[i])) { return false; } } return true; } public static bool operator ==(BlinkAmount a, BlinkAmount b) { if (System.Object.ReferenceEquals(a, null)) { return System.Object.ReferenceEquals(b, null); } return a.Equals(b); } public static bool operator !=(BlinkAmount a, BlinkAmount b) { return !(a == b); } public override bool Equals(System.Object obj) { return this.Equals(obj as BlinkAmount); } public bool Equals(BlinkAmount p) { if (System.Object.ReferenceEquals(p, null)) { return false; } return this._wasChecked.Equals(p._wasChecked) && this._blinkAmountLeft.Equals(p._blinkAmountLeft) && this._blinkAmountRight.Equals(p._blinkAmountRight); } public override int GetHashCode() { unchecked { int hash = 17; hash = hash * 23 + this._wasChecked.GetHashCode(); hash = hash * 23 + this._blinkAmountLeft.GetHashCode(); hash = hash * 23 + this._blinkAmountRight.GetHashCode(); return hash; } } } public partial class RobotObservedObject { private uint _timestamp; // uint_32 private Anki.Vector.Gateway.ObjectFamily _objectFamily; // ObjectFamily private Anki.Vector.Gateway.ObjectType _objectType; // ObjectType private int _objectID; // int_32 private Anki.Vector.Gateway.CladRect _img_rect; // CladRect private Anki.Vector.Gateway.PoseStruct3d _pose; // PoseStruct3d private float _topFaceOrientation_rad; // float_32 private byte _isActive; // uint_8 public uint timestamp { get { return _timestamp; } set { _timestamp = value; } } public Anki.Vector.Gateway.ObjectFamily objectFamily { get { return _objectFamily; } set { _objectFamily = value; } } public Anki.Vector.Gateway.ObjectType objectType { get { return _objectType; } set { _objectType = value; } } public int objectID { get { return _objectID; } set { _objectID = value; } } public Anki.Vector.Gateway.CladRect img_rect { get { return _img_rect; } set { if (value == null) { throw new System.ArgumentNullException("img_rect cannot be null.", "value"); } _img_rect = value; } } public Anki.Vector.Gateway.PoseStruct3d pose { get { return _pose; } set { if (value == null) { throw new System.ArgumentNullException("pose cannot be null.", "value"); } _pose = value; } } public float topFaceOrientation_rad { get { return _topFaceOrientation_rad; } set { _topFaceOrientation_rad = value; } } public byte isActive { get { return _isActive; } set { _isActive = value; } } /**** Constructors ****/ public RobotObservedObject() { this.img_rect = new Anki.Vector.Gateway.CladRect(); this.pose = new Anki.Vector.Gateway.PoseStruct3d(); } public RobotObservedObject(uint timestamp, Anki.Vector.Gateway.ObjectFamily objectFamily, Anki.Vector.Gateway.ObjectType objectType, int objectID, Anki.Vector.Gateway.CladRect img_rect, Anki.Vector.Gateway.PoseStruct3d pose, float topFaceOrientation_rad, byte isActive) { this.timestamp = timestamp; this.objectFamily = objectFamily; this.objectType = objectType; this.objectID = objectID; this.img_rect = img_rect; this.pose = pose; this.topFaceOrientation_rad = topFaceOrientation_rad; this.isActive = isActive; } public RobotObservedObject(System.IO.Stream stream) { Unpack(stream); } public RobotObservedObject(System.IO.BinaryReader reader) { Unpack(reader); } public RobotObservedObject Initialize(uint timestamp, Anki.Vector.Gateway.ObjectFamily objectFamily, Anki.Vector.Gateway.ObjectType objectType, int objectID, Anki.Vector.Gateway.CladRect img_rect, Anki.Vector.Gateway.PoseStruct3d pose, float topFaceOrientation_rad, byte isActive) { this.timestamp = timestamp; this.objectFamily = objectFamily; this.objectType = objectType; this.objectID = objectID; this.img_rect = img_rect; this.pose = pose; this.topFaceOrientation_rad = topFaceOrientation_rad; this.isActive = isActive; return this; } public void Unpack(System.IO.Stream stream) { System.IO.BinaryReader reader = new System.IO.BinaryReader(stream); Unpack(reader); } public void Unpack(System.IO.BinaryReader reader) { _timestamp = reader.ReadUInt32(); _objectFamily = (Anki.Vector.Gateway.ObjectFamily)reader.ReadInt32(); _objectType = (Anki.Vector.Gateway.ObjectType)reader.ReadInt32(); _objectID = reader.ReadInt32(); _img_rect = new Anki.Vector.Gateway.CladRect(reader); _pose = new Anki.Vector.Gateway.PoseStruct3d(reader); _topFaceOrientation_rad = reader.ReadSingle(); _isActive = reader.ReadByte(); } public void Pack(System.IO.Stream stream) { System.IO.BinaryWriter writer = new System.IO.BinaryWriter(stream); Pack(writer); } public void Pack(System.IO.BinaryWriter writer) { writer.Write((uint)_timestamp); writer.Write((int)_objectFamily); writer.Write((int)_objectType); writer.Write((int)_objectID); _img_rect.Pack(writer); _pose.Pack(writer); writer.Write((float)_topFaceOrientation_rad); writer.Write((byte)_isActive); } public int Size { get { return 69; } } public static bool ArrayEquals(System.Collections.Generic.IList a1, System.Collections.Generic.IList a2) { if (System.Object.ReferenceEquals(a1, a2)) return true; if (System.Object.ReferenceEquals(a1, null) || System.Object.ReferenceEquals(a2, null)) return false; if (a1.Count != a2.Count) return false; for (int i = 0; i < a1.Count; i++) { if (!a1[i].Equals(a2[i])) { return false; } } return true; } public static bool operator ==(RobotObservedObject a, RobotObservedObject b) { if (System.Object.ReferenceEquals(a, null)) { return System.Object.ReferenceEquals(b, null); } return a.Equals(b); } public static bool operator !=(RobotObservedObject a, RobotObservedObject b) { return !(a == b); } public override bool Equals(System.Object obj) { return this.Equals(obj as RobotObservedObject); } public bool Equals(RobotObservedObject p) { if (System.Object.ReferenceEquals(p, null)) { return false; } return this._timestamp.Equals(p._timestamp) && this._objectFamily.Equals(p._objectFamily) && this._objectType.Equals(p._objectType) && this._objectID.Equals(p._objectID) && this._img_rect.Equals(p._img_rect) && this._pose.Equals(p._pose) && this._topFaceOrientation_rad.Equals(p._topFaceOrientation_rad) && this._isActive.Equals(p._isActive); } public override int GetHashCode() { unchecked { int hash = 17; hash = hash * 23 + this._timestamp.GetHashCode(); hash = hash * 23 + this._objectFamily.GetHashCode(); hash = hash * 23 + this._objectType.GetHashCode(); hash = hash * 23 + this._objectID.GetHashCode(); hash = hash * 23 + this._img_rect.GetHashCode(); hash = hash * 23 + this._pose.GetHashCode(); hash = hash * 23 + this._topFaceOrientation_rad.GetHashCode(); hash = hash * 23 + this._isActive.GetHashCode(); return hash; } } } public partial class RobotObservedPossibleObject { private Anki.Vector.Gateway.RobotObservedObject _possibleObject; // RobotObservedObject public Anki.Vector.Gateway.RobotObservedObject possibleObject { get { return _possibleObject; } set { if (value == null) { throw new System.ArgumentNullException("possibleObject cannot be null.", "value"); } _possibleObject = value; } } /**** Constructors ****/ public RobotObservedPossibleObject() { this.possibleObject = new Anki.Vector.Gateway.RobotObservedObject(); } public RobotObservedPossibleObject(Anki.Vector.Gateway.RobotObservedObject possibleObject) { this.possibleObject = possibleObject; } public RobotObservedPossibleObject(System.IO.Stream stream) { Unpack(stream); } public RobotObservedPossibleObject(System.IO.BinaryReader reader) { Unpack(reader); } public RobotObservedPossibleObject Initialize(Anki.Vector.Gateway.RobotObservedObject possibleObject) { this.possibleObject = possibleObject; return this; } public void Unpack(System.IO.Stream stream) { System.IO.BinaryReader reader = new System.IO.BinaryReader(stream); Unpack(reader); } public void Unpack(System.IO.BinaryReader reader) { _possibleObject = new Anki.Vector.Gateway.RobotObservedObject(reader); } public void Pack(System.IO.Stream stream) { System.IO.BinaryWriter writer = new System.IO.BinaryWriter(stream); Pack(writer); } public void Pack(System.IO.BinaryWriter writer) { _possibleObject.Pack(writer); } public int Size { get { return 69; } } public static bool ArrayEquals(System.Collections.Generic.IList a1, System.Collections.Generic.IList a2) { if (System.Object.ReferenceEquals(a1, a2)) return true; if (System.Object.ReferenceEquals(a1, null) || System.Object.ReferenceEquals(a2, null)) return false; if (a1.Count != a2.Count) return false; for (int i = 0; i < a1.Count; i++) { if (!a1[i].Equals(a2[i])) { return false; } } return true; } public static bool operator ==(RobotObservedPossibleObject a, RobotObservedPossibleObject b) { if (System.Object.ReferenceEquals(a, null)) { return System.Object.ReferenceEquals(b, null); } return a.Equals(b); } public static bool operator !=(RobotObservedPossibleObject a, RobotObservedPossibleObject b) { return !(a == b); } public override bool Equals(System.Object obj) { return this.Equals(obj as RobotObservedPossibleObject); } public bool Equals(RobotObservedPossibleObject p) { if (System.Object.ReferenceEquals(p, null)) { return false; } return this._possibleObject.Equals(p._possibleObject); } public override int GetHashCode() { unchecked { int hash = 17; hash = hash * 23 + this._possibleObject.GetHashCode(); return hash; } } } public partial class RobotObservedFace { private int _faceID; // int_32 private uint _timestamp; // uint_32 private Anki.Vector.Gateway.PoseStruct3d _pose; // PoseStruct3d private Anki.Vector.Gateway.CladRect _img_rect; // CladRect private string _name; // string[uint_8] private Anki.Vector.Gateway.FacialExpression _expression; // FacialExpression private Anki.Vector.Gateway.SmileAmount _smileAmount; // SmileAmount private Anki.Vector.Gateway.Gaze _gaze; // Gaze private Anki.Vector.Gateway.BlinkAmount _blinkAmount; // BlinkAmount private byte[] _expressionValues; // uint_8[uint_8] private Anki.Vector.Gateway.CladPoint2d[] _leftEye; // CladPoint2d[uint_8] private Anki.Vector.Gateway.CladPoint2d[] _rightEye; // CladPoint2d[uint_8] private Anki.Vector.Gateway.CladPoint2d[] _nose; // CladPoint2d[uint_8] private Anki.Vector.Gateway.CladPoint2d[] _mouth; // CladPoint2d[uint_8] public int faceID { get { return _faceID; } set { _faceID = value; } } public uint timestamp { get { return _timestamp; } set { _timestamp = value; } } public Anki.Vector.Gateway.PoseStruct3d pose { get { return _pose; } set { if (value == null) { throw new System.ArgumentNullException("pose cannot be null.", "value"); } _pose = value; } } public Anki.Vector.Gateway.CladRect img_rect { get { return _img_rect; } set { if (value == null) { throw new System.ArgumentNullException("img_rect cannot be null.", "value"); } _img_rect = value; } } public string name { get { return _name; } set { if (!string.IsNullOrEmpty(value) && System.Text.Encoding.UTF8.GetByteCount(value) > 255) { throw new System.ArgumentException("name string is too long. Must decode to less than or equal to 255 bytes.", "value"); } _name = value; } } public Anki.Vector.Gateway.FacialExpression expression { get { return _expression; } set { _expression = value; } } public Anki.Vector.Gateway.SmileAmount smileAmount { get { return _smileAmount; } set { if (value == null) { throw new System.ArgumentNullException("smileAmount cannot be null.", "value"); } _smileAmount = value; } } public Anki.Vector.Gateway.Gaze gaze { get { return _gaze; } set { if (value == null) { throw new System.ArgumentNullException("gaze cannot be null.", "value"); } _gaze = value; } } public Anki.Vector.Gateway.BlinkAmount blinkAmount { get { return _blinkAmount; } set { if (value == null) { throw new System.ArgumentNullException("blinkAmount cannot be null.", "value"); } _blinkAmount = value; } } public byte[] expressionValues { get { return _expressionValues; } set { if (value != null && value.Length > 255) { throw new System.ArgumentException("expressionValues variable-length array is too long. Must be less than or equal to 255.", "value"); } _expressionValues = value; } } public Anki.Vector.Gateway.CladPoint2d[] leftEye { get { return _leftEye; } set { if (value != null && value.Length > 255) { throw new System.ArgumentException("leftEye variable-length array is too long. Must be less than or equal to 255.", "value"); } _leftEye = value; } } public Anki.Vector.Gateway.CladPoint2d[] rightEye { get { return _rightEye; } set { if (value != null && value.Length > 255) { throw new System.ArgumentException("rightEye variable-length array is too long. Must be less than or equal to 255.", "value"); } _rightEye = value; } } public Anki.Vector.Gateway.CladPoint2d[] nose { get { return _nose; } set { if (value != null && value.Length > 255) { throw new System.ArgumentException("nose variable-length array is too long. Must be less than or equal to 255.", "value"); } _nose = value; } } public Anki.Vector.Gateway.CladPoint2d[] mouth { get { return _mouth; } set { if (value != null && value.Length > 255) { throw new System.ArgumentException("mouth variable-length array is too long. Must be less than or equal to 255.", "value"); } _mouth = value; } } /**** Constructors ****/ public RobotObservedFace() { this.pose = new Anki.Vector.Gateway.PoseStruct3d(); this.img_rect = new Anki.Vector.Gateway.CladRect(); this.smileAmount = new Anki.Vector.Gateway.SmileAmount(); this.gaze = new Anki.Vector.Gateway.Gaze(); this.blinkAmount = new Anki.Vector.Gateway.BlinkAmount(); } public RobotObservedFace(int faceID, uint timestamp, Anki.Vector.Gateway.PoseStruct3d pose, Anki.Vector.Gateway.CladRect img_rect, string name, Anki.Vector.Gateway.FacialExpression expression, Anki.Vector.Gateway.SmileAmount smileAmount, Anki.Vector.Gateway.Gaze gaze, Anki.Vector.Gateway.BlinkAmount blinkAmount, byte[] expressionValues, Anki.Vector.Gateway.CladPoint2d[] leftEye, Anki.Vector.Gateway.CladPoint2d[] rightEye, Anki.Vector.Gateway.CladPoint2d[] nose, Anki.Vector.Gateway.CladPoint2d[] mouth) { this.faceID = faceID; this.timestamp = timestamp; this.pose = pose; this.img_rect = img_rect; this.name = name; this.expression = expression; this.smileAmount = smileAmount; this.gaze = gaze; this.blinkAmount = blinkAmount; this.expressionValues = expressionValues; this.leftEye = leftEye; this.rightEye = rightEye; this.nose = nose; this.mouth = mouth; } public RobotObservedFace(System.IO.Stream stream) { Unpack(stream); } public RobotObservedFace(System.IO.BinaryReader reader) { Unpack(reader); } public RobotObservedFace Initialize(int faceID, uint timestamp, Anki.Vector.Gateway.PoseStruct3d pose, Anki.Vector.Gateway.CladRect img_rect, string name, Anki.Vector.Gateway.FacialExpression expression, Anki.Vector.Gateway.SmileAmount smileAmount, Anki.Vector.Gateway.Gaze gaze, Anki.Vector.Gateway.BlinkAmount blinkAmount, byte[] expressionValues, Anki.Vector.Gateway.CladPoint2d[] leftEye, Anki.Vector.Gateway.CladPoint2d[] rightEye, Anki.Vector.Gateway.CladPoint2d[] nose, Anki.Vector.Gateway.CladPoint2d[] mouth) { this.faceID = faceID; this.timestamp = timestamp; this.pose = pose; this.img_rect = img_rect; this.name = name; this.expression = expression; this.smileAmount = smileAmount; this.gaze = gaze; this.blinkAmount = blinkAmount; this.expressionValues = expressionValues; this.leftEye = leftEye; this.rightEye = rightEye; this.nose = nose; this.mouth = mouth; return this; } public void Unpack(System.IO.Stream stream) { System.IO.BinaryReader reader = new System.IO.BinaryReader(stream); Unpack(reader); } public void Unpack(System.IO.BinaryReader reader) { _faceID = reader.ReadInt32(); _timestamp = reader.ReadUInt32(); _pose = new Anki.Vector.Gateway.PoseStruct3d(reader); _img_rect = new Anki.Vector.Gateway.CladRect(reader); int _name_length = (int)reader.ReadByte(); byte[] _name_bytes = reader.ReadBytes(_name_length); _name = System.Text.Encoding.UTF8.GetString(_name_bytes); _expression = (Anki.Vector.Gateway.FacialExpression)reader.ReadSByte(); _smileAmount = new Anki.Vector.Gateway.SmileAmount(reader); _gaze = new Anki.Vector.Gateway.Gaze(reader); _blinkAmount = new Anki.Vector.Gateway.BlinkAmount(reader); int _expressionValues_length = (int)reader.ReadByte(); _expressionValues = new byte[_expressionValues_length]; for (int i = 0; i < _expressionValues_length; ++i) { _expressionValues[i] = reader.ReadByte(); } int _leftEye_length = (int)reader.ReadByte(); _leftEye = new Anki.Vector.Gateway.CladPoint2d[_leftEye_length]; for (int i = 0; i < _leftEye_length; ++i) { _leftEye[i] = new Anki.Vector.Gateway.CladPoint2d(reader); } int _rightEye_length = (int)reader.ReadByte(); _rightEye = new Anki.Vector.Gateway.CladPoint2d[_rightEye_length]; for (int i = 0; i < _rightEye_length; ++i) { _rightEye[i] = new Anki.Vector.Gateway.CladPoint2d(reader); } int _nose_length = (int)reader.ReadByte(); _nose = new Anki.Vector.Gateway.CladPoint2d[_nose_length]; for (int i = 0; i < _nose_length; ++i) { _nose[i] = new Anki.Vector.Gateway.CladPoint2d(reader); } int _mouth_length = (int)reader.ReadByte(); _mouth = new Anki.Vector.Gateway.CladPoint2d[_mouth_length]; for (int i = 0; i < _mouth_length; ++i) { _mouth[i] = new Anki.Vector.Gateway.CladPoint2d(reader); } } public void Pack(System.IO.Stream stream) { System.IO.BinaryWriter writer = new System.IO.BinaryWriter(stream); Pack(writer); } public void Pack(System.IO.BinaryWriter writer) { writer.Write((int)_faceID); writer.Write((uint)_timestamp); _pose.Pack(writer); _img_rect.Pack(writer); if (_name != null) { byte[] _name_bytes = System.Text.Encoding.UTF8.GetBytes(_name); writer.Write((byte)_name_bytes.Length); writer.Write(_name_bytes); } else { writer.Write((byte)0); } writer.Write((sbyte)_expression); _smileAmount.Pack(writer); _gaze.Pack(writer); _blinkAmount.Pack(writer); if (_expressionValues != null) { writer.Write((byte)_expressionValues.Length); for (int i = 0; i < _expressionValues.Length; ++i) { writer.Write((byte)_expressionValues[i]); } } else { writer.Write((byte)0); } if (_leftEye != null) { writer.Write((byte)_leftEye.Length); for (int i = 0; i < _leftEye.Length; ++i) { if (_leftEye[i] == null) { throw new System.InvalidOperationException("Arrays in messages may not have null entries."); } _leftEye[i].Pack(writer); } } else { writer.Write((byte)0); } if (_rightEye != null) { writer.Write((byte)_rightEye.Length); for (int i = 0; i < _rightEye.Length; ++i) { if (_rightEye[i] == null) { throw new System.InvalidOperationException("Arrays in messages may not have null entries."); } _rightEye[i].Pack(writer); } } else { writer.Write((byte)0); } if (_nose != null) { writer.Write((byte)_nose.Length); for (int i = 0; i < _nose.Length; ++i) { if (_nose[i] == null) { throw new System.InvalidOperationException("Arrays in messages may not have null entries."); } _nose[i].Pack(writer); } } else { writer.Write((byte)0); } if (_mouth != null) { writer.Write((byte)_mouth.Length); for (int i = 0; i < _mouth.Length; ++i) { if (_mouth[i] == null) { throw new System.InvalidOperationException("Arrays in messages may not have null entries."); } _mouth[i].Pack(writer); } } else { writer.Write((byte)0); } } public int Size { get { int result = 0; result += 4; // int_32 result += 4; // uint_32 result += pose.Size; result += img_rect.Size; result += 1; // uint_8 if (name != null) { result += System.Text.Encoding.UTF8.GetByteCount(name); } result += 1; // FacialExpression result += smileAmount.Size; result += gaze.Size; result += blinkAmount.Size; result += 1; // uint_8 if (expressionValues != null) { result += expressionValues.Length * 1; // uint_8 } result += 1; // uint_8 if (leftEye != null) { result += leftEye.Length * 8; // CladPoint2d } result += 1; // uint_8 if (rightEye != null) { result += rightEye.Length * 8; // CladPoint2d } result += 1; // uint_8 if (nose != null) { result += nose.Length * 8; // CladPoint2d } result += 1; // uint_8 if (mouth != null) { result += mouth.Length * 8; // CladPoint2d } return result; } } public static bool ArrayEquals(System.Collections.Generic.IList a1, System.Collections.Generic.IList a2) { if (System.Object.ReferenceEquals(a1, a2)) return true; if (System.Object.ReferenceEquals(a1, null) || System.Object.ReferenceEquals(a2, null)) return false; if (a1.Count != a2.Count) return false; for (int i = 0; i < a1.Count; i++) { if (!a1[i].Equals(a2[i])) { return false; } } return true; } public static bool operator ==(RobotObservedFace a, RobotObservedFace b) { if (System.Object.ReferenceEquals(a, null)) { return System.Object.ReferenceEquals(b, null); } return a.Equals(b); } public static bool operator !=(RobotObservedFace a, RobotObservedFace b) { return !(a == b); } public override bool Equals(System.Object obj) { return this.Equals(obj as RobotObservedFace); } public bool Equals(RobotObservedFace p) { if (System.Object.ReferenceEquals(p, null)) { return false; } return this._faceID.Equals(p._faceID) && this._timestamp.Equals(p._timestamp) && this._pose.Equals(p._pose) && this._img_rect.Equals(p._img_rect) && this._name.Equals(p._name) && this._expression.Equals(p._expression) && this._smileAmount.Equals(p._smileAmount) && this._gaze.Equals(p._gaze) && this._blinkAmount.Equals(p._blinkAmount) && ArrayEquals(this._expressionValues,p._expressionValues) && ArrayEquals(this._leftEye,p._leftEye) && ArrayEquals(this._rightEye,p._rightEye) && ArrayEquals(this._nose,p._nose) && ArrayEquals(this._mouth,p._mouth); } public override int GetHashCode() { unchecked { int hash = 17; hash = hash * 23 + this._faceID.GetHashCode(); hash = hash * 23 + this._timestamp.GetHashCode(); hash = hash * 23 + this._pose.GetHashCode(); hash = hash * 23 + this._img_rect.GetHashCode(); hash = hash * 23 + this._expression.GetHashCode(); hash = hash * 23 + this._smileAmount.GetHashCode(); hash = hash * 23 + this._gaze.GetHashCode(); hash = hash * 23 + this._blinkAmount.GetHashCode(); return hash; } } } public partial class RobotChangedObservedFaceID { private int _oldID; // int_32 private int _newID; // int_32 public int oldID { get { return _oldID; } set { _oldID = value; } } public int newID { get { return _newID; } set { _newID = value; } } /**** Constructors ****/ public RobotChangedObservedFaceID() { } public RobotChangedObservedFaceID(int oldID, int newID) { this.oldID = oldID; this.newID = newID; } public RobotChangedObservedFaceID(System.IO.Stream stream) { Unpack(stream); } public RobotChangedObservedFaceID(System.IO.BinaryReader reader) { Unpack(reader); } public RobotChangedObservedFaceID Initialize(int oldID, int newID) { this.oldID = oldID; this.newID = newID; return this; } public void Unpack(System.IO.Stream stream) { System.IO.BinaryReader reader = new System.IO.BinaryReader(stream); Unpack(reader); } public void Unpack(System.IO.BinaryReader reader) { _oldID = reader.ReadInt32(); _newID = reader.ReadInt32(); } public void Pack(System.IO.Stream stream) { System.IO.BinaryWriter writer = new System.IO.BinaryWriter(stream); Pack(writer); } public void Pack(System.IO.BinaryWriter writer) { writer.Write((int)_oldID); writer.Write((int)_newID); } public int Size { get { return 8; } } public static bool ArrayEquals(System.Collections.Generic.IList a1, System.Collections.Generic.IList a2) { if (System.Object.ReferenceEquals(a1, a2)) return true; if (System.Object.ReferenceEquals(a1, null) || System.Object.ReferenceEquals(a2, null)) return false; if (a1.Count != a2.Count) return false; for (int i = 0; i < a1.Count; i++) { if (!a1[i].Equals(a2[i])) { return false; } } return true; } public static bool operator ==(RobotChangedObservedFaceID a, RobotChangedObservedFaceID b) { if (System.Object.ReferenceEquals(a, null)) { return System.Object.ReferenceEquals(b, null); } return a.Equals(b); } public static bool operator !=(RobotChangedObservedFaceID a, RobotChangedObservedFaceID b) { return !(a == b); } public override bool Equals(System.Object obj) { return this.Equals(obj as RobotChangedObservedFaceID); } public bool Equals(RobotChangedObservedFaceID p) { if (System.Object.ReferenceEquals(p, null)) { return false; } return this._oldID.Equals(p._oldID) && this._newID.Equals(p._newID); } public override int GetHashCode() { unchecked { int hash = 17; hash = hash * 23 + this._oldID.GetHashCode(); hash = hash * 23 + this._newID.GetHashCode(); return hash; } } } public partial class RequiredEmptyMessage { /**** Constructors ****/ public RequiredEmptyMessage() { } public RequiredEmptyMessage(System.IO.Stream stream) { Unpack(stream); } public RequiredEmptyMessage(System.IO.BinaryReader reader) { Unpack(reader); } public void Unpack(System.IO.Stream stream) { } public void Unpack(System.IO.BinaryReader reader) { } public void Pack(System.IO.Stream stream) { } public void Pack(System.IO.BinaryWriter writer) { } public int Size { get { return 0; } } } public class Event { public enum Tag { replaceMe, // 0 INVALID = 255 }; private Tag _tag = Tag.INVALID; public Tag GetTag() { return _tag; } private object _state = null; public object GetState() { return _state; } public Anki.Vector.Gateway.RequiredEmptyMessage replaceMe { get { if (_tag != Tag.replaceMe) { throw new System.InvalidOperationException(string.Format( "Cannot access union member \"replaceMe\" when a value of type {0} is stored.", _tag.ToString())); } return (Anki.Vector.Gateway.RequiredEmptyMessage)this._state; } set { _tag = (value != null) ? Tag.replaceMe : Tag.INVALID; _state = value; } } public Event Initialize(T state) { _state = state; if(typeof(T) == typeof(Anki.Vector.Gateway.RequiredEmptyMessage)) { _tag = Tag.replaceMe; } else { _state = null; _tag = Tag.INVALID; } return this; } /**** Constructors ****/ public Event() { } public Event(System.IO.Stream stream) { Unpack(stream); } public Event(System.IO.BinaryReader reader) { Unpack(reader); } public void Unpack(System.IO.Stream stream) { System.IO.BinaryReader reader = new System.IO.BinaryReader(stream); Unpack(reader); } public void Unpack(System.IO.BinaryReader reader) { Tag newTag = (Tag)reader.ReadByte(); switch(newTag) { case Tag.replaceMe: replaceMe = new Anki.Vector.Gateway.RequiredEmptyMessage(reader); break; default: break; } _tag = newTag; } public void Pack(System.IO.Stream stream) { System.IO.BinaryWriter writer = new System.IO.BinaryWriter(stream); Pack(writer); } public void Pack(System.IO.BinaryWriter writer) { writer.Write((byte)GetTag()); switch(GetTag()) { case Tag.replaceMe: if (replaceMe == null) { throw new System.InvalidOperationException("Arrays in messages may not have null entries."); } replaceMe.Pack(writer); break; default: break; } } public int Size { get { return 1; } } public static bool operator ==(Event a, Event b) { if (System.Object.ReferenceEquals(a, null)) { return System.Object.ReferenceEquals(b, null); } return a.Equals(b); } public static bool operator !=(Event a, Event b) { return !(a == b); } public override bool Equals(System.Object obj) { return this.Equals(obj as Event); } public bool Equals(Event p) { if (System.Object.ReferenceEquals(p, null)) { return false; } return (_tag == p._tag && _state.Equals(p._state)); } public override int GetHashCode() { unchecked { int hash = 17; hash = hash * 23 + this._tag.GetHashCode(); hash = hash * 23 + this._state.GetHashCode(); return hash; } } } public partial class RobotDeletedFixedCustomObjects { /**** Constructors ****/ public RobotDeletedFixedCustomObjects() { } public RobotDeletedFixedCustomObjects(System.IO.Stream stream) { Unpack(stream); } public RobotDeletedFixedCustomObjects(System.IO.BinaryReader reader) { Unpack(reader); } public void Unpack(System.IO.Stream stream) { } public void Unpack(System.IO.BinaryReader reader) { } public void Pack(System.IO.Stream stream) { } public void Pack(System.IO.BinaryWriter writer) { } public int Size { get { return 0; } } } public partial class RobotDeletedCustomMarkerObjects { /**** Constructors ****/ public RobotDeletedCustomMarkerObjects() { } public RobotDeletedCustomMarkerObjects(System.IO.Stream stream) { Unpack(stream); } public RobotDeletedCustomMarkerObjects(System.IO.BinaryReader reader) { Unpack(reader); } public void Unpack(System.IO.Stream stream) { } public void Unpack(System.IO.BinaryReader reader) { } public void Pack(System.IO.Stream stream) { } public void Pack(System.IO.BinaryWriter writer) { } public int Size { get { return 0; } } } public partial class CreatedFixedCustomObject { private uint _objectID; // uint_32 public uint objectID { get { return _objectID; } set { _objectID = value; } } /**** Constructors ****/ public CreatedFixedCustomObject() { } public CreatedFixedCustomObject(uint objectID) { this.objectID = objectID; } public CreatedFixedCustomObject(System.IO.Stream stream) { Unpack(stream); } public CreatedFixedCustomObject(System.IO.BinaryReader reader) { Unpack(reader); } public CreatedFixedCustomObject Initialize(uint objectID) { this.objectID = objectID; return this; } public void Unpack(System.IO.Stream stream) { System.IO.BinaryReader reader = new System.IO.BinaryReader(stream); Unpack(reader); } public void Unpack(System.IO.BinaryReader reader) { _objectID = reader.ReadUInt32(); } public void Pack(System.IO.Stream stream) { System.IO.BinaryWriter writer = new System.IO.BinaryWriter(stream); Pack(writer); } public void Pack(System.IO.BinaryWriter writer) { writer.Write((uint)_objectID); } public int Size { get { return 4; } } public static bool ArrayEquals(System.Collections.Generic.IList a1, System.Collections.Generic.IList a2) { if (System.Object.ReferenceEquals(a1, a2)) return true; if (System.Object.ReferenceEquals(a1, null) || System.Object.ReferenceEquals(a2, null)) return false; if (a1.Count != a2.Count) return false; for (int i = 0; i < a1.Count; i++) { if (!a1[i].Equals(a2[i])) { return false; } } return true; } public static bool operator ==(CreatedFixedCustomObject a, CreatedFixedCustomObject b) { if (System.Object.ReferenceEquals(a, null)) { return System.Object.ReferenceEquals(b, null); } return a.Equals(b); } public static bool operator !=(CreatedFixedCustomObject a, CreatedFixedCustomObject b) { return !(a == b); } public override bool Equals(System.Object obj) { return this.Equals(obj as CreatedFixedCustomObject); } public bool Equals(CreatedFixedCustomObject p) { if (System.Object.ReferenceEquals(p, null)) { return false; } return this._objectID.Equals(p._objectID); } public override int GetHashCode() { unchecked { int hash = 17; hash = hash * 23 + this._objectID.GetHashCode(); return hash; } } } public partial class DefinedCustomObject { private bool _success; // bool public bool success { get { return _success; } set { _success = value; } } /**** Constructors ****/ public DefinedCustomObject() { } public DefinedCustomObject(bool success) { this.success = success; } public DefinedCustomObject(System.IO.Stream stream) { Unpack(stream); } public DefinedCustomObject(System.IO.BinaryReader reader) { Unpack(reader); } public DefinedCustomObject Initialize(bool success) { this.success = success; return this; } public void Unpack(System.IO.Stream stream) { System.IO.BinaryReader reader = new System.IO.BinaryReader(stream); Unpack(reader); } public void Unpack(System.IO.BinaryReader reader) { _success = reader.ReadBoolean(); } public void Pack(System.IO.Stream stream) { System.IO.BinaryWriter writer = new System.IO.BinaryWriter(stream); Pack(writer); } public void Pack(System.IO.BinaryWriter writer) { writer.Write((bool)_success); } public int Size { get { return 1; } } public static bool ArrayEquals(System.Collections.Generic.IList a1, System.Collections.Generic.IList a2) { if (System.Object.ReferenceEquals(a1, a2)) return true; if (System.Object.ReferenceEquals(a1, null) || System.Object.ReferenceEquals(a2, null)) return false; if (a1.Count != a2.Count) return false; for (int i = 0; i < a1.Count; i++) { if (!a1[i].Equals(a2[i])) { return false; } } return true; } public static bool operator ==(DefinedCustomObject a, DefinedCustomObject b) { if (System.Object.ReferenceEquals(a, null)) { return System.Object.ReferenceEquals(b, null); } return a.Equals(b); } public static bool operator !=(DefinedCustomObject a, DefinedCustomObject b) { return !(a == b); } public override bool Equals(System.Object obj) { return this.Equals(obj as DefinedCustomObject); } public bool Equals(DefinedCustomObject p) { if (System.Object.ReferenceEquals(p, null)) { return false; } return this._success.Equals(p._success); } public override int GetHashCode() { unchecked { int hash = 17; hash = hash * 23 + this._success.GetHashCode(); return hash; } } } public enum ENodeContentTypeEnum : byte { Unknown = 0, ClearOfObstacle = 1, ClearOfCliff = 2, ObstacleCube = 3, ObstacleProx = 4, ObstacleProxExplored = 5, ObstacleUnrecognized = 6, Cliff = 7, InterestingEdge = 8, NotInterestingEdge = 9 }; public partial class MemoryMapQuadInfo { private Anki.Vector.Gateway.ENodeContentTypeEnum _content; // ENodeContentTypeEnum private byte _depth; // uint_8 private uint _colorRGBA; // uint_32 public Anki.Vector.Gateway.ENodeContentTypeEnum content { get { return _content; } set { _content = value; } } public byte depth { get { return _depth; } set { _depth = value; } } public uint colorRGBA { get { return _colorRGBA; } set { _colorRGBA = value; } } /**** Constructors ****/ public MemoryMapQuadInfo() { } public MemoryMapQuadInfo(Anki.Vector.Gateway.ENodeContentTypeEnum content, byte depth, uint colorRGBA) { this.content = content; this.depth = depth; this.colorRGBA = colorRGBA; } public MemoryMapQuadInfo(System.IO.Stream stream) { Unpack(stream); } public MemoryMapQuadInfo(System.IO.BinaryReader reader) { Unpack(reader); } public MemoryMapQuadInfo Initialize(Anki.Vector.Gateway.ENodeContentTypeEnum content, byte depth, uint colorRGBA) { this.content = content; this.depth = depth; this.colorRGBA = colorRGBA; return this; } public void Unpack(System.IO.Stream stream) { System.IO.BinaryReader reader = new System.IO.BinaryReader(stream); Unpack(reader); } public void Unpack(System.IO.BinaryReader reader) { _content = (Anki.Vector.Gateway.ENodeContentTypeEnum)reader.ReadByte(); _depth = reader.ReadByte(); _colorRGBA = reader.ReadUInt32(); } public void Pack(System.IO.Stream stream) { System.IO.BinaryWriter writer = new System.IO.BinaryWriter(stream); Pack(writer); } public void Pack(System.IO.BinaryWriter writer) { writer.Write((byte)_content); writer.Write((byte)_depth); writer.Write((uint)_colorRGBA); } public int Size { get { return 6; } } public static bool ArrayEquals(System.Collections.Generic.IList a1, System.Collections.Generic.IList a2) { if (System.Object.ReferenceEquals(a1, a2)) return true; if (System.Object.ReferenceEquals(a1, null) || System.Object.ReferenceEquals(a2, null)) return false; if (a1.Count != a2.Count) return false; for (int i = 0; i < a1.Count; i++) { if (!a1[i].Equals(a2[i])) { return false; } } return true; } public static bool operator ==(MemoryMapQuadInfo a, MemoryMapQuadInfo b) { if (System.Object.ReferenceEquals(a, null)) { return System.Object.ReferenceEquals(b, null); } return a.Equals(b); } public static bool operator !=(MemoryMapQuadInfo a, MemoryMapQuadInfo b) { return !(a == b); } public override bool Equals(System.Object obj) { return this.Equals(obj as MemoryMapQuadInfo); } public bool Equals(MemoryMapQuadInfo p) { if (System.Object.ReferenceEquals(p, null)) { return false; } return this._content.Equals(p._content) && this._depth.Equals(p._depth) && this._colorRGBA.Equals(p._colorRGBA); } public override int GetHashCode() { unchecked { int hash = 17; hash = hash * 23 + this._content.GetHashCode(); hash = hash * 23 + this._depth.GetHashCode(); hash = hash * 23 + this._colorRGBA.GetHashCode(); return hash; } } } public partial class MemoryMapMessageBegin { private uint _originId; // uint_32 private int _rootDepth; // int_32 private float _rootSize_mm; // float_32 private float _rootCenterX; // float_32 private float _rootCenterY; // float_32 public uint originId { get { return _originId; } set { _originId = value; } } public int rootDepth { get { return _rootDepth; } set { _rootDepth = value; } } public float rootSize_mm { get { return _rootSize_mm; } set { _rootSize_mm = value; } } public float rootCenterX { get { return _rootCenterX; } set { _rootCenterX = value; } } public float rootCenterY { get { return _rootCenterY; } set { _rootCenterY = value; } } /**** Constructors ****/ public MemoryMapMessageBegin() { } public MemoryMapMessageBegin(uint originId, int rootDepth, float rootSize_mm, float rootCenterX, float rootCenterY) { this.originId = originId; this.rootDepth = rootDepth; this.rootSize_mm = rootSize_mm; this.rootCenterX = rootCenterX; this.rootCenterY = rootCenterY; } public MemoryMapMessageBegin(System.IO.Stream stream) { Unpack(stream); } public MemoryMapMessageBegin(System.IO.BinaryReader reader) { Unpack(reader); } public MemoryMapMessageBegin Initialize(uint originId, int rootDepth, float rootSize_mm, float rootCenterX, float rootCenterY) { this.originId = originId; this.rootDepth = rootDepth; this.rootSize_mm = rootSize_mm; this.rootCenterX = rootCenterX; this.rootCenterY = rootCenterY; return this; } public void Unpack(System.IO.Stream stream) { System.IO.BinaryReader reader = new System.IO.BinaryReader(stream); Unpack(reader); } public void Unpack(System.IO.BinaryReader reader) { _originId = reader.ReadUInt32(); _rootDepth = reader.ReadInt32(); _rootSize_mm = reader.ReadSingle(); _rootCenterX = reader.ReadSingle(); _rootCenterY = reader.ReadSingle(); } public void Pack(System.IO.Stream stream) { System.IO.BinaryWriter writer = new System.IO.BinaryWriter(stream); Pack(writer); } public void Pack(System.IO.BinaryWriter writer) { writer.Write((uint)_originId); writer.Write((int)_rootDepth); writer.Write((float)_rootSize_mm); writer.Write((float)_rootCenterX); writer.Write((float)_rootCenterY); } public int Size { get { return 20; } } public static bool ArrayEquals(System.Collections.Generic.IList a1, System.Collections.Generic.IList a2) { if (System.Object.ReferenceEquals(a1, a2)) return true; if (System.Object.ReferenceEquals(a1, null) || System.Object.ReferenceEquals(a2, null)) return false; if (a1.Count != a2.Count) return false; for (int i = 0; i < a1.Count; i++) { if (!a1[i].Equals(a2[i])) { return false; } } return true; } public static bool operator ==(MemoryMapMessageBegin a, MemoryMapMessageBegin b) { if (System.Object.ReferenceEquals(a, null)) { return System.Object.ReferenceEquals(b, null); } return a.Equals(b); } public static bool operator !=(MemoryMapMessageBegin a, MemoryMapMessageBegin b) { return !(a == b); } public override bool Equals(System.Object obj) { return this.Equals(obj as MemoryMapMessageBegin); } public bool Equals(MemoryMapMessageBegin p) { if (System.Object.ReferenceEquals(p, null)) { return false; } return this._originId.Equals(p._originId) && this._rootDepth.Equals(p._rootDepth) && this._rootSize_mm.Equals(p._rootSize_mm) && this._rootCenterX.Equals(p._rootCenterX) && this._rootCenterY.Equals(p._rootCenterY); } public override int GetHashCode() { unchecked { int hash = 17; hash = hash * 23 + this._originId.GetHashCode(); hash = hash * 23 + this._rootDepth.GetHashCode(); hash = hash * 23 + this._rootSize_mm.GetHashCode(); hash = hash * 23 + this._rootCenterX.GetHashCode(); hash = hash * 23 + this._rootCenterY.GetHashCode(); return hash; } } } public partial class MemoryMapMessage { private Anki.Vector.Gateway.MemoryMapQuadInfo[] _quadInfos; // MemoryMapQuadInfo[uint_16] public Anki.Vector.Gateway.MemoryMapQuadInfo[] quadInfos { get { return _quadInfos; } set { if (value != null && value.Length > 65535) { throw new System.ArgumentException("quadInfos variable-length array is too long. Must be less than or equal to 65535.", "value"); } _quadInfos = value; } } /**** Constructors ****/ public MemoryMapMessage() { } public MemoryMapMessage(Anki.Vector.Gateway.MemoryMapQuadInfo[] quadInfos) { this.quadInfos = quadInfos; } public MemoryMapMessage(System.IO.Stream stream) { Unpack(stream); } public MemoryMapMessage(System.IO.BinaryReader reader) { Unpack(reader); } public MemoryMapMessage Initialize(Anki.Vector.Gateway.MemoryMapQuadInfo[] quadInfos) { this.quadInfos = quadInfos; return this; } public void Unpack(System.IO.Stream stream) { System.IO.BinaryReader reader = new System.IO.BinaryReader(stream); Unpack(reader); } public void Unpack(System.IO.BinaryReader reader) { int _quadInfos_length = (int)reader.ReadUInt16(); _quadInfos = new Anki.Vector.Gateway.MemoryMapQuadInfo[_quadInfos_length]; for (int i = 0; i < _quadInfos_length; ++i) { _quadInfos[i] = new Anki.Vector.Gateway.MemoryMapQuadInfo(reader); } } public void Pack(System.IO.Stream stream) { System.IO.BinaryWriter writer = new System.IO.BinaryWriter(stream); Pack(writer); } public void Pack(System.IO.BinaryWriter writer) { if (_quadInfos != null) { writer.Write((ushort)_quadInfos.Length); for (int i = 0; i < _quadInfos.Length; ++i) { if (_quadInfos[i] == null) { throw new System.InvalidOperationException("Arrays in messages may not have null entries."); } _quadInfos[i].Pack(writer); } } else { writer.Write((ushort)0); } } public int Size { get { int result = 0; result += 2; // uint_16 if (quadInfos != null) { result += quadInfos.Length * 6; // MemoryMapQuadInfo } return result; } } public static bool ArrayEquals(System.Collections.Generic.IList a1, System.Collections.Generic.IList a2) { if (System.Object.ReferenceEquals(a1, a2)) return true; if (System.Object.ReferenceEquals(a1, null) || System.Object.ReferenceEquals(a2, null)) return false; if (a1.Count != a2.Count) return false; for (int i = 0; i < a1.Count; i++) { if (!a1[i].Equals(a2[i])) { return false; } } return true; } public static bool operator ==(MemoryMapMessage a, MemoryMapMessage b) { if (System.Object.ReferenceEquals(a, null)) { return System.Object.ReferenceEquals(b, null); } return a.Equals(b); } public static bool operator !=(MemoryMapMessage a, MemoryMapMessage b) { return !(a == b); } public override bool Equals(System.Object obj) { return this.Equals(obj as MemoryMapMessage); } public bool Equals(MemoryMapMessage p) { if (System.Object.ReferenceEquals(p, null)) { return false; } return ArrayEquals(this._quadInfos,p._quadInfos); } public override int GetHashCode() { unchecked { int hash = 17; return hash; } } } public partial class MemoryMapMessageEnd { /**** Constructors ****/ public MemoryMapMessageEnd() { } public MemoryMapMessageEnd(System.IO.Stream stream) { Unpack(stream); } public MemoryMapMessageEnd(System.IO.BinaryReader reader) { Unpack(reader); } public void Unpack(System.IO.Stream stream) { } public void Unpack(System.IO.BinaryReader reader) { } public void Pack(System.IO.Stream stream) { } public void Pack(System.IO.BinaryWriter writer) { } public int Size { get { return 0; } } } public class MessageRobotToExternal { public enum Tag { UiDeviceConnected = 0x0, // 0 RobotCompletedAction = 0x1, // 1 Event = 0x2, // 2 EnrolledNamesResponse = 0x5, // 5 RobotObservedFace = 0x6, // 6 RobotChangedObservedFaceID = 0x7, // 7 ObjectConnectionState = 0xa, // 10 ObjectMoved = 0xb, // 11 ObjectStoppedMoving = 0xc, // 12 ObjectUpAxisChanged = 0xd, // 13 ObjectTapped = 0xe, // 14 ObjectAccel = 0xf, // 15 RobotObservedObject = 0x10, // 16 ObjectAvailable = 0x11, // 17 RobotDeletedFixedCustomObjects = 0x12, // 18 RobotDeletedCustomMarkerObjects = 0x13, // 19 CreatedFixedCustomObject = 0x14, // 20 DefinedCustomObject = 0x15, // 21 MemoryMapMessageBegin = 0x16, // 22 MemoryMapMessage = 0x17, // 23 MemoryMapMessageEnd = 0x18, // 24 INVALID = 255 }; private Tag _tag = Tag.INVALID; public Tag GetTag() { return _tag; } private object _state = null; public object GetState() { return _state; } public Anki.Vector.Gateway.UiDeviceConnected UiDeviceConnected { get { if (_tag != Tag.UiDeviceConnected) { throw new System.InvalidOperationException(string.Format( "Cannot access union member \"UiDeviceConnected\" when a value of type {0} is stored.", _tag.ToString())); } return (Anki.Vector.Gateway.UiDeviceConnected)this._state; } set { _tag = (value != null) ? Tag.UiDeviceConnected : Tag.INVALID; _state = value; } } public Anki.Vector.Gateway.RobotCompletedAction RobotCompletedAction { get { if (_tag != Tag.RobotCompletedAction) { throw new System.InvalidOperationException(string.Format( "Cannot access union member \"RobotCompletedAction\" when a value of type {0} is stored.", _tag.ToString())); } return (Anki.Vector.Gateway.RobotCompletedAction)this._state; } set { _tag = (value != null) ? Tag.RobotCompletedAction : Tag.INVALID; _state = value; } } public Anki.Vector.Gateway.Event Event { get { if (_tag != Tag.Event) { throw new System.InvalidOperationException(string.Format( "Cannot access union member \"Event\" when a value of type {0} is stored.", _tag.ToString())); } return (Anki.Vector.Gateway.Event)this._state; } set { _tag = (value != null) ? Tag.Event : Tag.INVALID; _state = value; } } public Anki.Vector.Gateway.EnrolledNamesResponse EnrolledNamesResponse { get { if (_tag != Tag.EnrolledNamesResponse) { throw new System.InvalidOperationException(string.Format( "Cannot access union member \"EnrolledNamesResponse\" when a value of type {0} is stored.", _tag.ToString())); } return (Anki.Vector.Gateway.EnrolledNamesResponse)this._state; } set { _tag = (value != null) ? Tag.EnrolledNamesResponse : Tag.INVALID; _state = value; } } public Anki.Vector.Gateway.RobotObservedFace RobotObservedFace { get { if (_tag != Tag.RobotObservedFace) { throw new System.InvalidOperationException(string.Format( "Cannot access union member \"RobotObservedFace\" when a value of type {0} is stored.", _tag.ToString())); } return (Anki.Vector.Gateway.RobotObservedFace)this._state; } set { _tag = (value != null) ? Tag.RobotObservedFace : Tag.INVALID; _state = value; } } public Anki.Vector.Gateway.RobotChangedObservedFaceID RobotChangedObservedFaceID { get { if (_tag != Tag.RobotChangedObservedFaceID) { throw new System.InvalidOperationException(string.Format( "Cannot access union member \"RobotChangedObservedFaceID\" when a value of type {0} is stored.", _tag.ToString())); } return (Anki.Vector.Gateway.RobotChangedObservedFaceID)this._state; } set { _tag = (value != null) ? Tag.RobotChangedObservedFaceID : Tag.INVALID; _state = value; } } public Anki.Vector.Gateway.ObjectConnectionState ObjectConnectionState { get { if (_tag != Tag.ObjectConnectionState) { throw new System.InvalidOperationException(string.Format( "Cannot access union member \"ObjectConnectionState\" when a value of type {0} is stored.", _tag.ToString())); } return (Anki.Vector.Gateway.ObjectConnectionState)this._state; } set { _tag = (value != null) ? Tag.ObjectConnectionState : Tag.INVALID; _state = value; } } public Anki.Vector.Gateway.ObjectMoved ObjectMoved { get { if (_tag != Tag.ObjectMoved) { throw new System.InvalidOperationException(string.Format( "Cannot access union member \"ObjectMoved\" when a value of type {0} is stored.", _tag.ToString())); } return (Anki.Vector.Gateway.ObjectMoved)this._state; } set { _tag = (value != null) ? Tag.ObjectMoved : Tag.INVALID; _state = value; } } public Anki.Vector.Gateway.ObjectStoppedMoving ObjectStoppedMoving { get { if (_tag != Tag.ObjectStoppedMoving) { throw new System.InvalidOperationException(string.Format( "Cannot access union member \"ObjectStoppedMoving\" when a value of type {0} is stored.", _tag.ToString())); } return (Anki.Vector.Gateway.ObjectStoppedMoving)this._state; } set { _tag = (value != null) ? Tag.ObjectStoppedMoving : Tag.INVALID; _state = value; } } public Anki.Vector.Gateway.ObjectUpAxisChanged ObjectUpAxisChanged { get { if (_tag != Tag.ObjectUpAxisChanged) { throw new System.InvalidOperationException(string.Format( "Cannot access union member \"ObjectUpAxisChanged\" when a value of type {0} is stored.", _tag.ToString())); } return (Anki.Vector.Gateway.ObjectUpAxisChanged)this._state; } set { _tag = (value != null) ? Tag.ObjectUpAxisChanged : Tag.INVALID; _state = value; } } public Anki.Vector.Gateway.ObjectTapped ObjectTapped { get { if (_tag != Tag.ObjectTapped) { throw new System.InvalidOperationException(string.Format( "Cannot access union member \"ObjectTapped\" when a value of type {0} is stored.", _tag.ToString())); } return (Anki.Vector.Gateway.ObjectTapped)this._state; } set { _tag = (value != null) ? Tag.ObjectTapped : Tag.INVALID; _state = value; } } public Anki.Vector.Gateway.ObjectAccel ObjectAccel { get { if (_tag != Tag.ObjectAccel) { throw new System.InvalidOperationException(string.Format( "Cannot access union member \"ObjectAccel\" when a value of type {0} is stored.", _tag.ToString())); } return (Anki.Vector.Gateway.ObjectAccel)this._state; } set { _tag = (value != null) ? Tag.ObjectAccel : Tag.INVALID; _state = value; } } public Anki.Vector.Gateway.RobotObservedObject RobotObservedObject { get { if (_tag != Tag.RobotObservedObject) { throw new System.InvalidOperationException(string.Format( "Cannot access union member \"RobotObservedObject\" when a value of type {0} is stored.", _tag.ToString())); } return (Anki.Vector.Gateway.RobotObservedObject)this._state; } set { _tag = (value != null) ? Tag.RobotObservedObject : Tag.INVALID; _state = value; } } public Anki.Vector.Gateway.ObjectAvailable ObjectAvailable { get { if (_tag != Tag.ObjectAvailable) { throw new System.InvalidOperationException(string.Format( "Cannot access union member \"ObjectAvailable\" when a value of type {0} is stored.", _tag.ToString())); } return (Anki.Vector.Gateway.ObjectAvailable)this._state; } set { _tag = (value != null) ? Tag.ObjectAvailable : Tag.INVALID; _state = value; } } public Anki.Vector.Gateway.RobotDeletedFixedCustomObjects RobotDeletedFixedCustomObjects { get { if (_tag != Tag.RobotDeletedFixedCustomObjects) { throw new System.InvalidOperationException(string.Format( "Cannot access union member \"RobotDeletedFixedCustomObjects\" when a value of type {0} is stored.", _tag.ToString())); } return (Anki.Vector.Gateway.RobotDeletedFixedCustomObjects)this._state; } set { _tag = (value != null) ? Tag.RobotDeletedFixedCustomObjects : Tag.INVALID; _state = value; } } public Anki.Vector.Gateway.RobotDeletedCustomMarkerObjects RobotDeletedCustomMarkerObjects { get { if (_tag != Tag.RobotDeletedCustomMarkerObjects) { throw new System.InvalidOperationException(string.Format( "Cannot access union member \"RobotDeletedCustomMarkerObjects\" when a value of type {0} is stored.", _tag.ToString())); } return (Anki.Vector.Gateway.RobotDeletedCustomMarkerObjects)this._state; } set { _tag = (value != null) ? Tag.RobotDeletedCustomMarkerObjects : Tag.INVALID; _state = value; } } public Anki.Vector.Gateway.CreatedFixedCustomObject CreatedFixedCustomObject { get { if (_tag != Tag.CreatedFixedCustomObject) { throw new System.InvalidOperationException(string.Format( "Cannot access union member \"CreatedFixedCustomObject\" when a value of type {0} is stored.", _tag.ToString())); } return (Anki.Vector.Gateway.CreatedFixedCustomObject)this._state; } set { _tag = (value != null) ? Tag.CreatedFixedCustomObject : Tag.INVALID; _state = value; } } public Anki.Vector.Gateway.DefinedCustomObject DefinedCustomObject { get { if (_tag != Tag.DefinedCustomObject) { throw new System.InvalidOperationException(string.Format( "Cannot access union member \"DefinedCustomObject\" when a value of type {0} is stored.", _tag.ToString())); } return (Anki.Vector.Gateway.DefinedCustomObject)this._state; } set { _tag = (value != null) ? Tag.DefinedCustomObject : Tag.INVALID; _state = value; } } public Anki.Vector.Gateway.MemoryMapMessageBegin MemoryMapMessageBegin { get { if (_tag != Tag.MemoryMapMessageBegin) { throw new System.InvalidOperationException(string.Format( "Cannot access union member \"MemoryMapMessageBegin\" when a value of type {0} is stored.", _tag.ToString())); } return (Anki.Vector.Gateway.MemoryMapMessageBegin)this._state; } set { _tag = (value != null) ? Tag.MemoryMapMessageBegin : Tag.INVALID; _state = value; } } public Anki.Vector.Gateway.MemoryMapMessage MemoryMapMessage { get { if (_tag != Tag.MemoryMapMessage) { throw new System.InvalidOperationException(string.Format( "Cannot access union member \"MemoryMapMessage\" when a value of type {0} is stored.", _tag.ToString())); } return (Anki.Vector.Gateway.MemoryMapMessage)this._state; } set { _tag = (value != null) ? Tag.MemoryMapMessage : Tag.INVALID; _state = value; } } public Anki.Vector.Gateway.MemoryMapMessageEnd MemoryMapMessageEnd { get { if (_tag != Tag.MemoryMapMessageEnd) { throw new System.InvalidOperationException(string.Format( "Cannot access union member \"MemoryMapMessageEnd\" when a value of type {0} is stored.", _tag.ToString())); } return (Anki.Vector.Gateway.MemoryMapMessageEnd)this._state; } set { _tag = (value != null) ? Tag.MemoryMapMessageEnd : Tag.INVALID; _state = value; } } public MessageRobotToExternal Initialize(T state) { _state = state; if(typeof(T) == typeof(Anki.Vector.Gateway.UiDeviceConnected)) { _tag = Tag.UiDeviceConnected; } else if(typeof(T) == typeof(Anki.Vector.Gateway.RobotCompletedAction)) { _tag = Tag.RobotCompletedAction; } else if(typeof(T) == typeof(Anki.Vector.Gateway.Event)) { _tag = Tag.Event; } else if(typeof(T) == typeof(Anki.Vector.Gateway.EnrolledNamesResponse)) { _tag = Tag.EnrolledNamesResponse; } else if(typeof(T) == typeof(Anki.Vector.Gateway.RobotObservedFace)) { _tag = Tag.RobotObservedFace; } else if(typeof(T) == typeof(Anki.Vector.Gateway.RobotChangedObservedFaceID)) { _tag = Tag.RobotChangedObservedFaceID; } else if(typeof(T) == typeof(Anki.Vector.Gateway.ObjectConnectionState)) { _tag = Tag.ObjectConnectionState; } else if(typeof(T) == typeof(Anki.Vector.Gateway.ObjectMoved)) { _tag = Tag.ObjectMoved; } else if(typeof(T) == typeof(Anki.Vector.Gateway.ObjectStoppedMoving)) { _tag = Tag.ObjectStoppedMoving; } else if(typeof(T) == typeof(Anki.Vector.Gateway.ObjectUpAxisChanged)) { _tag = Tag.ObjectUpAxisChanged; } else if(typeof(T) == typeof(Anki.Vector.Gateway.ObjectTapped)) { _tag = Tag.ObjectTapped; } else if(typeof(T) == typeof(Anki.Vector.Gateway.ObjectAccel)) { _tag = Tag.ObjectAccel; } else if(typeof(T) == typeof(Anki.Vector.Gateway.RobotObservedObject)) { _tag = Tag.RobotObservedObject; } else if(typeof(T) == typeof(Anki.Vector.Gateway.ObjectAvailable)) { _tag = Tag.ObjectAvailable; } else if(typeof(T) == typeof(Anki.Vector.Gateway.RobotDeletedFixedCustomObjects)) { _tag = Tag.RobotDeletedFixedCustomObjects; } else if(typeof(T) == typeof(Anki.Vector.Gateway.RobotDeletedCustomMarkerObjects)) { _tag = Tag.RobotDeletedCustomMarkerObjects; } else if(typeof(T) == typeof(Anki.Vector.Gateway.CreatedFixedCustomObject)) { _tag = Tag.CreatedFixedCustomObject; } else if(typeof(T) == typeof(Anki.Vector.Gateway.DefinedCustomObject)) { _tag = Tag.DefinedCustomObject; } else if(typeof(T) == typeof(Anki.Vector.Gateway.MemoryMapMessageBegin)) { _tag = Tag.MemoryMapMessageBegin; } else if(typeof(T) == typeof(Anki.Vector.Gateway.MemoryMapMessage)) { _tag = Tag.MemoryMapMessage; } else if(typeof(T) == typeof(Anki.Vector.Gateway.MemoryMapMessageEnd)) { _tag = Tag.MemoryMapMessageEnd; } else { _state = null; _tag = Tag.INVALID; } return this; } /**** Constructors ****/ public MessageRobotToExternal() { } public MessageRobotToExternal(System.IO.Stream stream) { Unpack(stream); } public MessageRobotToExternal(System.IO.BinaryReader reader) { Unpack(reader); } public void Unpack(System.IO.Stream stream) { System.IO.BinaryReader reader = new System.IO.BinaryReader(stream); Unpack(reader); } public void Unpack(System.IO.BinaryReader reader) { Tag newTag = (Tag)reader.ReadByte(); switch(newTag) { case Tag.UiDeviceConnected: UiDeviceConnected = new Anki.Vector.Gateway.UiDeviceConnected(reader); break; case Tag.RobotCompletedAction: RobotCompletedAction = new Anki.Vector.Gateway.RobotCompletedAction(reader); break; case Tag.Event: Event = new Anki.Vector.Gateway.Event(reader); break; case Tag.EnrolledNamesResponse: EnrolledNamesResponse = new Anki.Vector.Gateway.EnrolledNamesResponse(reader); break; case Tag.RobotObservedFace: RobotObservedFace = new Anki.Vector.Gateway.RobotObservedFace(reader); break; case Tag.RobotChangedObservedFaceID: RobotChangedObservedFaceID = new Anki.Vector.Gateway.RobotChangedObservedFaceID(reader); break; case Tag.ObjectConnectionState: ObjectConnectionState = new Anki.Vector.Gateway.ObjectConnectionState(reader); break; case Tag.ObjectMoved: ObjectMoved = new Anki.Vector.Gateway.ObjectMoved(reader); break; case Tag.ObjectStoppedMoving: ObjectStoppedMoving = new Anki.Vector.Gateway.ObjectStoppedMoving(reader); break; case Tag.ObjectUpAxisChanged: ObjectUpAxisChanged = new Anki.Vector.Gateway.ObjectUpAxisChanged(reader); break; case Tag.ObjectTapped: ObjectTapped = new Anki.Vector.Gateway.ObjectTapped(reader); break; case Tag.ObjectAccel: ObjectAccel = new Anki.Vector.Gateway.ObjectAccel(reader); break; case Tag.RobotObservedObject: RobotObservedObject = new Anki.Vector.Gateway.RobotObservedObject(reader); break; case Tag.ObjectAvailable: ObjectAvailable = new Anki.Vector.Gateway.ObjectAvailable(reader); break; case Tag.RobotDeletedFixedCustomObjects: RobotDeletedFixedCustomObjects = new Anki.Vector.Gateway.RobotDeletedFixedCustomObjects(reader); break; case Tag.RobotDeletedCustomMarkerObjects: RobotDeletedCustomMarkerObjects = new Anki.Vector.Gateway.RobotDeletedCustomMarkerObjects(reader); break; case Tag.CreatedFixedCustomObject: CreatedFixedCustomObject = new Anki.Vector.Gateway.CreatedFixedCustomObject(reader); break; case Tag.DefinedCustomObject: DefinedCustomObject = new Anki.Vector.Gateway.DefinedCustomObject(reader); break; case Tag.MemoryMapMessageBegin: MemoryMapMessageBegin = new Anki.Vector.Gateway.MemoryMapMessageBegin(reader); break; case Tag.MemoryMapMessage: MemoryMapMessage = new Anki.Vector.Gateway.MemoryMapMessage(reader); break; case Tag.MemoryMapMessageEnd: MemoryMapMessageEnd = new Anki.Vector.Gateway.MemoryMapMessageEnd(reader); break; default: break; } _tag = newTag; } public void Pack(System.IO.Stream stream) { System.IO.BinaryWriter writer = new System.IO.BinaryWriter(stream); Pack(writer); } public void Pack(System.IO.BinaryWriter writer) { writer.Write((byte)GetTag()); switch(GetTag()) { case Tag.UiDeviceConnected: if (UiDeviceConnected == null) { throw new System.InvalidOperationException("Arrays in messages may not have null entries."); } UiDeviceConnected.Pack(writer); break; case Tag.RobotCompletedAction: if (RobotCompletedAction == null) { throw new System.InvalidOperationException("Arrays in messages may not have null entries."); } RobotCompletedAction.Pack(writer); break; case Tag.Event: if (Event == null) { throw new System.InvalidOperationException("Arrays in messages may not have null entries."); } Event.Pack(writer); break; case Tag.EnrolledNamesResponse: if (EnrolledNamesResponse == null) { throw new System.InvalidOperationException("Arrays in messages may not have null entries."); } EnrolledNamesResponse.Pack(writer); break; case Tag.RobotObservedFace: if (RobotObservedFace == null) { throw new System.InvalidOperationException("Arrays in messages may not have null entries."); } RobotObservedFace.Pack(writer); break; case Tag.RobotChangedObservedFaceID: if (RobotChangedObservedFaceID == null) { throw new System.InvalidOperationException("Arrays in messages may not have null entries."); } RobotChangedObservedFaceID.Pack(writer); break; case Tag.ObjectConnectionState: if (ObjectConnectionState == null) { throw new System.InvalidOperationException("Arrays in messages may not have null entries."); } ObjectConnectionState.Pack(writer); break; case Tag.ObjectMoved: if (ObjectMoved == null) { throw new System.InvalidOperationException("Arrays in messages may not have null entries."); } ObjectMoved.Pack(writer); break; case Tag.ObjectStoppedMoving: if (ObjectStoppedMoving == null) { throw new System.InvalidOperationException("Arrays in messages may not have null entries."); } ObjectStoppedMoving.Pack(writer); break; case Tag.ObjectUpAxisChanged: if (ObjectUpAxisChanged == null) { throw new System.InvalidOperationException("Arrays in messages may not have null entries."); } ObjectUpAxisChanged.Pack(writer); break; case Tag.ObjectTapped: if (ObjectTapped == null) { throw new System.InvalidOperationException("Arrays in messages may not have null entries."); } ObjectTapped.Pack(writer); break; case Tag.ObjectAccel: if (ObjectAccel == null) { throw new System.InvalidOperationException("Arrays in messages may not have null entries."); } ObjectAccel.Pack(writer); break; case Tag.RobotObservedObject: if (RobotObservedObject == null) { throw new System.InvalidOperationException("Arrays in messages may not have null entries."); } RobotObservedObject.Pack(writer); break; case Tag.ObjectAvailable: if (ObjectAvailable == null) { throw new System.InvalidOperationException("Arrays in messages may not have null entries."); } ObjectAvailable.Pack(writer); break; case Tag.RobotDeletedFixedCustomObjects: if (RobotDeletedFixedCustomObjects == null) { throw new System.InvalidOperationException("Arrays in messages may not have null entries."); } RobotDeletedFixedCustomObjects.Pack(writer); break; case Tag.RobotDeletedCustomMarkerObjects: if (RobotDeletedCustomMarkerObjects == null) { throw new System.InvalidOperationException("Arrays in messages may not have null entries."); } RobotDeletedCustomMarkerObjects.Pack(writer); break; case Tag.CreatedFixedCustomObject: if (CreatedFixedCustomObject == null) { throw new System.InvalidOperationException("Arrays in messages may not have null entries."); } CreatedFixedCustomObject.Pack(writer); break; case Tag.DefinedCustomObject: if (DefinedCustomObject == null) { throw new System.InvalidOperationException("Arrays in messages may not have null entries."); } DefinedCustomObject.Pack(writer); break; case Tag.MemoryMapMessageBegin: if (MemoryMapMessageBegin == null) { throw new System.InvalidOperationException("Arrays in messages may not have null entries."); } MemoryMapMessageBegin.Pack(writer); break; case Tag.MemoryMapMessage: if (MemoryMapMessage == null) { throw new System.InvalidOperationException("Arrays in messages may not have null entries."); } MemoryMapMessage.Pack(writer); break; case Tag.MemoryMapMessageEnd: if (MemoryMapMessageEnd == null) { throw new System.InvalidOperationException("Arrays in messages may not have null entries."); } MemoryMapMessageEnd.Pack(writer); break; default: break; } } public int Size { get { int result = 1; // tag = byte switch(GetTag()) { case Tag.UiDeviceConnected: if (UiDeviceConnected == null) { throw new System.InvalidOperationException("Messages may not have null members."); } result += UiDeviceConnected.Size; break; case Tag.RobotCompletedAction: if (RobotCompletedAction == null) { throw new System.InvalidOperationException("Messages may not have null members."); } result += RobotCompletedAction.Size; break; case Tag.Event: if (Event == null) { throw new System.InvalidOperationException("Messages may not have null members."); } result += Event.Size; break; case Tag.EnrolledNamesResponse: if (EnrolledNamesResponse == null) { throw new System.InvalidOperationException("Messages may not have null members."); } result += EnrolledNamesResponse.Size; break; case Tag.RobotObservedFace: if (RobotObservedFace == null) { throw new System.InvalidOperationException("Messages may not have null members."); } result += RobotObservedFace.Size; break; case Tag.RobotChangedObservedFaceID: if (RobotChangedObservedFaceID == null) { throw new System.InvalidOperationException("Messages may not have null members."); } result += RobotChangedObservedFaceID.Size; break; case Tag.ObjectConnectionState: if (ObjectConnectionState == null) { throw new System.InvalidOperationException("Messages may not have null members."); } result += ObjectConnectionState.Size; break; case Tag.ObjectMoved: if (ObjectMoved == null) { throw new System.InvalidOperationException("Messages may not have null members."); } result += ObjectMoved.Size; break; case Tag.ObjectStoppedMoving: if (ObjectStoppedMoving == null) { throw new System.InvalidOperationException("Messages may not have null members."); } result += ObjectStoppedMoving.Size; break; case Tag.ObjectUpAxisChanged: if (ObjectUpAxisChanged == null) { throw new System.InvalidOperationException("Messages may not have null members."); } result += ObjectUpAxisChanged.Size; break; case Tag.ObjectTapped: if (ObjectTapped == null) { throw new System.InvalidOperationException("Messages may not have null members."); } result += ObjectTapped.Size; break; case Tag.ObjectAccel: if (ObjectAccel == null) { throw new System.InvalidOperationException("Messages may not have null members."); } result += ObjectAccel.Size; break; case Tag.RobotObservedObject: if (RobotObservedObject == null) { throw new System.InvalidOperationException("Messages may not have null members."); } result += RobotObservedObject.Size; break; case Tag.ObjectAvailable: if (ObjectAvailable == null) { throw new System.InvalidOperationException("Messages may not have null members."); } result += ObjectAvailable.Size; break; case Tag.RobotDeletedFixedCustomObjects: if (RobotDeletedFixedCustomObjects == null) { throw new System.InvalidOperationException("Messages may not have null members."); } result += RobotDeletedFixedCustomObjects.Size; break; case Tag.RobotDeletedCustomMarkerObjects: if (RobotDeletedCustomMarkerObjects == null) { throw new System.InvalidOperationException("Messages may not have null members."); } result += RobotDeletedCustomMarkerObjects.Size; break; case Tag.CreatedFixedCustomObject: if (CreatedFixedCustomObject == null) { throw new System.InvalidOperationException("Messages may not have null members."); } result += CreatedFixedCustomObject.Size; break; case Tag.DefinedCustomObject: if (DefinedCustomObject == null) { throw new System.InvalidOperationException("Messages may not have null members."); } result += DefinedCustomObject.Size; break; case Tag.MemoryMapMessageBegin: if (MemoryMapMessageBegin == null) { throw new System.InvalidOperationException("Messages may not have null members."); } result += MemoryMapMessageBegin.Size; break; case Tag.MemoryMapMessage: if (MemoryMapMessage == null) { throw new System.InvalidOperationException("Messages may not have null members."); } result += MemoryMapMessage.Size; break; case Tag.MemoryMapMessageEnd: if (MemoryMapMessageEnd == null) { throw new System.InvalidOperationException("Messages may not have null members."); } result += MemoryMapMessageEnd.Size; break; default: // Just tag size break; } return result; } } public static bool operator ==(MessageRobotToExternal a, MessageRobotToExternal b) { if (System.Object.ReferenceEquals(a, null)) { return System.Object.ReferenceEquals(b, null); } return a.Equals(b); } public static bool operator !=(MessageRobotToExternal a, MessageRobotToExternal b) { return !(a == b); } public override bool Equals(System.Object obj) { return this.Equals(obj as MessageRobotToExternal); } public bool Equals(MessageRobotToExternal p) { if (System.Object.ReferenceEquals(p, null)) { return false; } return (_tag == p._tag && _state.Equals(p._state)); } public override int GetHashCode() { unchecked { int hash = 17; hash = hash * 23 + this._tag.GetHashCode(); hash = hash * 23 + this._state.GetHashCode(); return hash; } } } } // namespace Gateway } // namespace Vector } // namespace Anki