Exemplo n.º 1
0
 public MAvatar(string ID, string Name, MAvatarDescription Description, MAvatarPostureValues PostureValues) : this()
 {
     this.ID            = ID;
     this.Name          = Name;
     this.Description   = Description;
     this.PostureValues = PostureValues;
 }
Exemplo n.º 2
0
        public void Read(TProtocol iprot)
        {
            iprot.IncrementRecursionDepth();
            try
            {
                bool   isset_ID            = false;
                bool   isset_Name          = false;
                bool   isset_Description   = false;
                bool   isset_PostureValues = 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();
                            isset_Name = true;
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

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

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

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

                    case 6:
                        if (field.Type == TType.Map)
                        {
                            {
                                Properties = new Dictionary <string, string>();
                                TMap _map33 = iprot.ReadMapBegin();
                                for (int _i34 = 0; _i34 < _map33.Count; ++_i34)
                                {
                                    string _key35;
                                    string _val36;
                                    _key35             = iprot.ReadString();
                                    _val36             = iprot.ReadString();
                                    Properties[_key35] = _val36;
                                }
                                iprot.ReadMapEnd();
                            }
                        }
                        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");
                }
                if (!isset_Name)
                {
                    throw new TProtocolException(TProtocolException.INVALID_DATA, "required field Name not set");
                }
                if (!isset_Description)
                {
                    throw new TProtocolException(TProtocolException.INVALID_DATA, "required field Description not set");
                }
                if (!isset_PostureValues)
                {
                    throw new TProtocolException(TProtocolException.INVALID_DATA, "required field PostureValues not set");
                }
            }
            finally
            {
                iprot.DecrementRecursionDepth();
            }
        }