Beispiel #1
0
 public void Read (TProtocol iprot)
 {
   TField field;
   iprot.ReadStructBegin();
   while (true)
   {
     field = iprot.ReadFieldBegin();
     if (field.Type == TType.Stop) { 
       break;
     }
     switch (field.ID)
     {
       case 1:
         if (field.Type == TType.Byte) {
           BagType = iprot.ReadByte();
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 2:
         if (field.Type == TType.Struct) {
           Info = new KXSGCodec.ItemInfo();
           Info.Read(iprot);
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       default: 
         TProtocolUtil.Skip(iprot, field.Type);
         break;
     }
     iprot.ReadFieldEnd();
   }
   iprot.ReadStructEnd();
 }
Beispiel #2
0
 public void Read (TProtocol iprot)
 {
   TField field;
   iprot.ReadStructBegin();
   while (true)
   {
     field = iprot.ReadFieldBegin();
     if (field.Type == TType.Stop) { 
       break;
     }
     switch (field.ID)
     {
       case 1:
         if (field.Type == TType.Byte) {
           BagType = iprot.ReadByte();
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 2:
         if (field.Type == TType.I16) {
           Capacity = iprot.ReadI16();
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 3:
         if (field.Type == TType.List) {
           {
             ItemInfos = new List<KXSGCodec.ItemInfo>();
             TList _list0 = iprot.ReadListBegin();
             for( int _i1 = 0; _i1 < _list0.Count; ++_i1)
             {
               KXSGCodec.ItemInfo _elem2 = new KXSGCodec.ItemInfo();
               _elem2 = new KXSGCodec.ItemInfo();
               _elem2.Read(iprot);
               ItemInfos.Add(_elem2);
             }
             iprot.ReadListEnd();
           }
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       default: 
         TProtocolUtil.Skip(iprot, field.Type);
         break;
     }
     iprot.ReadFieldEnd();
   }
   iprot.ReadStructEnd();
 }
 public void Read (TProtocol iprot)
 {
   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) {
           {
             HeroInfos = new List<KXSGCodec.HeroInfo>();
             TList _list46 = iprot.ReadListBegin();
             for( int _i47 = 0; _i47 < _list46.Count; ++_i47)
             {
               KXSGCodec.HeroInfo _elem48 = new KXSGCodec.HeroInfo();
               _elem48 = new KXSGCodec.HeroInfo();
               _elem48.Read(iprot);
               HeroInfos.Add(_elem48);
             }
             iprot.ReadListEnd();
           }
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 2:
         if (field.Type == TType.List) {
           {
             ItemInfos = new List<KXSGCodec.ItemInfo>();
             TList _list49 = iprot.ReadListBegin();
             for( int _i50 = 0; _i50 < _list49.Count; ++_i50)
             {
               KXSGCodec.ItemInfo _elem51 = new KXSGCodec.ItemInfo();
               _elem51 = new KXSGCodec.ItemInfo();
               _elem51.Read(iprot);
               ItemInfos.Add(_elem51);
             }
             iprot.ReadListEnd();
           }
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       default: 
         TProtocolUtil.Skip(iprot, field.Type);
         break;
     }
     iprot.ReadFieldEnd();
   }
   iprot.ReadStructEnd();
 }