Esempio n. 1
0
        /// <summary>
        /// 写入字节流(简版)
        /// </summary>
        protected override void toWriteBytesSimple(BytesWriteStream stream)
        {
            stream.writeUTF(this.name);

            stream.writeInt(this.type);

            stream.writeUTF(this.style);

            if (this.children != null)
            {
                stream.writeBoolean(true);
                stream.writeLen(this.children.size());
                if (!this.children.isEmpty())
                {
                    UIObjectData[] childrenVValues = this.children.getValues();
                    for (int childrenVI = 0, childrenVLen = this.children.length(); childrenVI < childrenVLen; ++childrenVI)
                    {
                        UIObjectData childrenV = childrenVValues[childrenVI];
                        if (childrenV != null)
                        {
                            stream.writeBoolean(true);
                            childrenV.writeBytesSimple(stream);
                        }
                        else
                        {
                            stream.writeBoolean(false);
                        }
                    }
                }
            }
            else
            {
                stream.writeBoolean(false);
            }

            if (this.intArgs != null)
            {
                stream.writeBoolean(true);
                int[] intArgsT = this.intArgs;
                stream.writeLen(intArgsT.Length);
                for (int intArgsVI = 0, intArgsVLen = intArgsT.Length; intArgsVI < intArgsVLen; ++intArgsVI)
                {
                    int intArgsV = intArgsT[intArgsVI];
                    stream.writeInt(intArgsV);
                }
            }
            else
            {
                stream.writeBoolean(false);
            }

            if (this.strArgs != null)
            {
                stream.writeBoolean(true);
                string[] strArgsT = this.strArgs;
                stream.writeLen(strArgsT.Length);
                for (int strArgsVI = 0, strArgsVLen = strArgsT.Length; strArgsVI < strArgsVLen; ++strArgsVI)
                {
                    string strArgsV = strArgsT[strArgsVI];
                    stream.writeUTF(strArgsV);
                }
            }
            else
            {
                stream.writeBoolean(false);
            }
        }