public void Read(TProtocol iprot)
        {
            iprot.IncrementRecursionDepth();
            try
            {
                bool   isset_ID = 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)
                        {
                            ID       = iprot.ReadString();
                            isset_ID = true;
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 2:
                        if (field.Type == TType.String)
                        {
                            Name = iprot.ReadString();
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 3:
                        if (field.Type == TType.Struct)
                        {
                            Transform = new MTransformUpdate();
                            Transform.Read(iprot);
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 4:
                        if (field.Type == TType.Struct)
                        {
                            Collider = new MCollider();
                            Collider.Read(iprot);
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 5:
                        if (field.Type == TType.Struct)
                        {
                            Mesh = new MMesh();
                            Mesh.Read(iprot);
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 6:
                        if (field.Type == TType.Struct)
                        {
                            PhysicsProperties = new MPhysicsProperties();
                            PhysicsProperties.Read(iprot);
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 7:
                        if (field.Type == TType.List)
                        {
                            {
                                HandPoses = new List <MMIStandard.MHandPose>();
                                TList _list126 = iprot.ReadListBegin();
                                for (int _i127 = 0; _i127 < _list126.Count; ++_i127)
                                {
                                    MMIStandard.MHandPose _elem128;
                                    _elem128 = new MMIStandard.MHandPose();
                                    _elem128.Read(iprot);
                                    HandPoses.Add(_elem128);
                                }
                                iprot.ReadListEnd();
                            }
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 8:
                        if (field.Type == TType.List)
                        {
                            {
                                Properties = new List <MPropertyUpdate>();
                                TList _list129 = iprot.ReadListBegin();
                                for (int _i130 = 0; _i130 < _list129.Count; ++_i130)
                                {
                                    MPropertyUpdate _elem131;
                                    _elem131 = new MPropertyUpdate();
                                    _elem131.Read(iprot);
                                    Properties.Add(_elem131);
                                }
                                iprot.ReadListEnd();
                            }
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 9:
                        if (field.Type == TType.List)
                        {
                            {
                                Attachments = new List <MAttachment>();
                                TList _list132 = iprot.ReadListBegin();
                                for (int _i133 = 0; _i133 < _list132.Count; ++_i133)
                                {
                                    MAttachment _elem134;
                                    _elem134 = new MAttachment();
                                    _elem134.Read(iprot);
                                    Attachments.Add(_elem134);
                                }
                                iprot.ReadListEnd();
                            }
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 10:
                        if (field.Type == TType.List)
                        {
                            {
                                Constraints = new List <MMIStandard.MConstraint>();
                                TList _list135 = iprot.ReadListBegin();
                                for (int _i136 = 0; _i136 < _list135.Count; ++_i136)
                                {
                                    MMIStandard.MConstraint _elem137;
                                    _elem137 = new MMIStandard.MConstraint();
                                    _elem137.Read(iprot);
                                    Constraints.Add(_elem137);
                                }
                                iprot.ReadListEnd();
                            }
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    default:
                        TProtocolUtil.Skip(iprot, field.Type);
                        break;
                    }
                    iprot.ReadFieldEnd();
                }
                iprot.ReadStructEnd();
                if (!isset_ID)
                {
                    throw new TProtocolException(TProtocolException.INVALID_DATA, "required field ID not set");
                }
            }
            finally
            {
                iprot.DecrementRecursionDepth();
            }
        }
Example #2
0
        public void Read(TProtocol iprot)
        {
            iprot.IncrementRecursionDepth();
            try
            {
                bool   isset_ID = 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)
                        {
                            ID       = iprot.ReadString();
                            isset_ID = true;
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 2:
                        if (field.Type == TType.Struct)
                        {
                            PostureValues = new MMIStandard.MAvatarPostureValues();
                            PostureValues.Read(iprot);
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 3:
                        if (field.Type == TType.List)
                        {
                            {
                                SceneObjects = new List <string>();
                                TList _list166 = iprot.ReadListBegin();
                                for (int _i167 = 0; _i167 < _list166.Count; ++_i167)
                                {
                                    string _elem168;
                                    _elem168 = iprot.ReadString();
                                    SceneObjects.Add(_elem168);
                                }
                                iprot.ReadListEnd();
                            }
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 4:
                        if (field.Type == TType.Struct)
                        {
                            Description = new MMIStandard.MAvatarDescription();
                            Description.Read(iprot);
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 5:
                        if (field.Type == TType.List)
                        {
                            {
                                Properties = new List <MPropertyUpdate>();
                                TList _list169 = iprot.ReadListBegin();
                                for (int _i170 = 0; _i170 < _list169.Count; ++_i170)
                                {
                                    MPropertyUpdate _elem171;
                                    _elem171 = new MPropertyUpdate();
                                    _elem171.Read(iprot);
                                    Properties.Add(_elem171);
                                }
                                iprot.ReadListEnd();
                            }
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    default:
                        TProtocolUtil.Skip(iprot, field.Type);
                        break;
                    }
                    iprot.ReadFieldEnd();
                }
                iprot.ReadStructEnd();
                if (!isset_ID)
                {
                    throw new TProtocolException(TProtocolException.INVALID_DATA, "required field ID not set");
                }
            }
            finally
            {
                iprot.DecrementRecursionDepth();
            }
        }