Example #1
0
 /** 从字节读取 */
 public void readBytes(BytesReadStream stream)
 {
     id   = stream.readInt();
     name = stream.readUTF();
     type = stream.readByte();
 }
Example #2
0
        /// <summary>
        /// 读取字节流(简版)
        /// </summary>
        protected override void toReadBytesSimple(BytesReadStream stream)
        {
            this.key = stream.readInt();

            this.value = stream.readInt();
        }
Example #3
0
 /// <summary>
 /// 读取字节流(简版)
 /// </summary>
 protected override void toReadBytesSimple(BytesReadStream stream)
 {
     this.timeSeconds = stream.readLong();
 }
Example #4
0
        /// <summary>
        /// 读取字节流(完整版)
        /// </summary>
        protected override void toReadBytesFull(BytesReadStream stream)
        {
            stream.startReadObj();

            this.name = stream.readUTF();

            this.type = stream.readInt();

            this.style = stream.readUTF();

            if (stream.readBoolean())
            {
                int childrenLen = stream.readLen();
                if (this.children != null)
                {
                    this.children.clear();
                    this.children.ensureCapacity(childrenLen);
                }
                else
                {
                    this.children = new SList <UIObjectData>();
                }

                SList <UIObjectData> childrenT = this.children;
                for (int childrenI = childrenLen - 1; childrenI >= 0; --childrenI)
                {
                    UIObjectData childrenV;
                    if (stream.readBoolean())
                    {
                        childrenV = (UIObjectData)stream.createData(UIObjectData.dataID);
                        childrenV.readBytesFull(stream);
                    }
                    else
                    {
                        childrenV = null;
                    }

                    childrenT.add(childrenV);
                }
            }
            else
            {
                this.children = null;
            }

            if (stream.readBoolean())
            {
                int intArgsLen = stream.readLen();
                if (this.intArgs == null || this.intArgs.Length != intArgsLen)
                {
                    this.intArgs = new int[intArgsLen];
                }
                int[] intArgsT = this.intArgs;
                for (int intArgsI = 0; intArgsI < intArgsLen; ++intArgsI)
                {
                    int intArgsV;
                    intArgsV = stream.readInt();

                    intArgsT[intArgsI] = intArgsV;
                }
            }
            else
            {
                this.intArgs = null;
            }

            if (stream.readBoolean())
            {
                int strArgsLen = stream.readLen();
                if (this.strArgs == null || this.strArgs.Length != strArgsLen)
                {
                    this.strArgs = new string[strArgsLen];
                }
                string[] strArgsT = this.strArgs;
                for (int strArgsI = 0; strArgsI < strArgsLen; ++strArgsI)
                {
                    string strArgsV;
                    strArgsV = stream.readUTF();

                    strArgsT[strArgsI] = strArgsV;
                }
            }
            else
            {
                this.strArgs = null;
            }

            stream.endReadObj();
        }
Example #5
0
        /// <summary>
        /// 读取字节流(简版)
        /// </summary>
        protected override void toReadBytesSimple(BytesReadStream stream)
        {
            this.timePass = stream.readInt();

            this.timeMax = stream.readInt();
        }
Example #6
0
 /// <summary>
 /// 实际读取字节流(简版,为通信)
 /// </summary>
 protected virtual void toReadBytesSimple(BytesReadStream stream)
 {
 }
Example #7
0
 /// <summary>
 /// 实际读取字节流(完整版,为DB)
 /// </summary>
 protected virtual void toReadBytesFull(BytesReadStream stream)
 {
 }
Example #8
0
        /// <summary>
        /// 读取字节流(简版,为通信)
        /// </summary>
        public void readBytesSimple(BytesReadStream stream)
        {
            toReadBytesSimple(stream);

            afterRead();
        }