コード例 #1
0
        override public void Decode(ReadBuffer rb)
        {
            long c = Eproto.UnpackArray(rb);

            if (c <= 0)
            {
                return;
            }
            {
                long n = Eproto.UnpackArray(rb);
                if (n < 0)
                {
                    this.info = null;
                }
                else
                {
                    this.info = new table_info[n];
                    for (int i = 0; i < n; ++i)
                    {
                        table_info v = null;
                        if (rb.NextIsNil())
                        {
                            rb.MoveNext();
                        }
                        else
                        {
                            v = new table_info(); v.Decode(rb);
                        }
                        this.info[i] = v;
                    }
                }
            }
            if (--c <= 0)
            {
                return;
            }
            Eproto.UnpackDiscard(rb, c);
        }
コード例 #2
0
        override public void Decode(ReadBuffer rb)
        {
            long c = Eproto.UnpackArray(rb);

            if (c <= 0)
            {
                return;
            }
            Eproto.UnpackInteger(rb, ref this.result);
            if (--c <= 0)
            {
                return;
            }
            if (rb.NextIsNil())
            {
                rb.MoveNext();
            }
            else
            {
                this.info = new table_info(); this.info.Decode(rb);
            }
            if (--c <= 0)
            {
                return;
            }
            Eproto.UnpackInteger(rb, ref this.prop_type);
            if (--c <= 0)
            {
                return;
            }
            Eproto.UnpackInteger(rb, ref this.prop_num);
            if (--c <= 0)
            {
                return;
            }
            Eproto.UnpackDiscard(rb, c);
        }
コード例 #3
0
 override public void Encode(WriteBuffer wb)
 {
     Eproto.PackArray(wb, 1);
     if (this.info == null)
     {
         Eproto.PackNil(wb);
     }
     else
     {
         Eproto.PackArray(wb, this.info.Length);
         for (int i = 0; i < this.info.Length; ++i)
         {
             table_info v = this.info[i];
             if (v == null)
             {
                 Eproto.PackNil(wb);
             }
             else
             {
                 v.Encode(wb);
             }
         }
     }
 }