public void Read(TProtocol iprot) { iprot.IncrementRecursionDepth(); try { bool isset_Joints = false; TField field; iprot.ReadStructBegin(); while (true) { field = iprot.ReadFieldBegin(); if (field.Type == TType.Stop) { break; } switch (field.ID) { case 1: if (field.Type == TType.List) { { Joints = new List <MJoint>(); TList _list16 = iprot.ReadListBegin(); for (int _i17 = 0; _i17 < _list16.Count; ++_i17) { MJoint _elem18; _elem18 = new MJoint(); _elem18.Read(iprot); Joints.Add(_elem18); } iprot.ReadListEnd(); } isset_Joints = true; } else { TProtocolUtil.Skip(iprot, field.Type); } break; case 2: if (field.Type == TType.Map) { { Properties = new Dictionary <string, string>(); TMap _map19 = iprot.ReadMapBegin(); for (int _i20 = 0; _i20 < _map19.Count; ++_i20) { string _key21; string _val22; _key21 = iprot.ReadString(); _val22 = iprot.ReadString(); Properties[_key21] = _val22; } iprot.ReadMapEnd(); } } else { TProtocolUtil.Skip(iprot, field.Type); } break; default: TProtocolUtil.Skip(iprot, field.Type); break; } iprot.ReadFieldEnd(); } iprot.ReadStructEnd(); if (!isset_Joints) { throw new TProtocolException(TProtocolException.INVALID_DATA, "required field Joints not set"); } } finally { iprot.DecrementRecursionDepth(); } }
public void Read(TProtocol iprot) { iprot.IncrementRecursionDepth(); try { bool isset_AvatarID = false; bool isset_Joints = false; TField field; iprot.ReadStructBegin(); while (true) { field = iprot.ReadFieldBegin(); if (field.Type == TType.Stop) { break; } switch (field.ID) { case 1: if (field.Type == TType.String) { AvatarID = iprot.ReadString(); isset_AvatarID = true; } else { TProtocolUtil.Skip(iprot, field.Type); } break; case 2: if (field.Type == TType.List) { { Joints = new List <MJoint>(); TList _list12 = iprot.ReadListBegin(); for (int _i13 = 0; _i13 < _list12.Count; ++_i13) { MJoint _elem14; _elem14 = new MJoint(); _elem14.Read(iprot); Joints.Add(_elem14); } iprot.ReadListEnd(); } isset_Joints = true; } else { TProtocolUtil.Skip(iprot, field.Type); } break; default: TProtocolUtil.Skip(iprot, field.Type); break; } iprot.ReadFieldEnd(); } iprot.ReadStructEnd(); if (!isset_AvatarID) { throw new TProtocolException(TProtocolException.INVALID_DATA, "required field AvatarID not set"); } if (!isset_Joints) { throw new TProtocolException(TProtocolException.INVALID_DATA, "required field Joints not set"); } } finally { iprot.DecrementRecursionDepth(); } }