Example #1
0
        /// <summary>
        /// Serializes a the Attributes stored in this Instance to the BinaryStream
        /// </summary>
        /// <param name="writer">The Stream the Data should be stored to</param>
        /// <remarks>
        /// Be sure that the Position of the stream is Proper on
        /// return (i.e. must point to the first Byte after your actual File)
        /// </remarks>
        public override void Serialize(System.IO.BinaryWriter writer)
        {
            writer.Write(version);

            writer.Write(rn.BlockName);
            writer.Write(rn.BlockID);
            rn.Serialize(writer);

            writer.Write(bn.BlockName);
            writer.Write(bn.BlockID);
            bn.Serialize(writer);

            writer.Write(tn.BlockName);
            writer.Write(tn.BlockID);
            tn.Serialize(writer);

            writer.Write(unknown1);
            writer.Write((uint)items.Length);
            for (int i = 0; i < items.Length; i++)
            {
                writer.Write(items[i]);
            }

            writer.Write(unknown2);
        }
Example #2
0
        /// <summary>
        /// Serializes a the Attributes stored in this Instance to the BinaryStream
        /// </summary>
        /// <param name="writer">The Stream the Data should be stored to</param>
        /// <remarks>
        /// Be sure that the Position of the stream is Proper on
        /// return (i.e. must point to the first Byte after your actual File)
        /// </remarks>
        public override void Serialize(System.IO.BinaryWriter writer)
        {
            writer.Write(version);

            writer.Write(vrnb.BlockName);
            writer.Write(vrnb.BlockID);
            vrnb.Serialize(writer);

            writer.Write(rn.BlockName);
            writer.Write(rn.BlockID);
            rn.Serialize(writer);

            writer.Write(bn.BlockName);
            writer.Write(bn.BlockID);
            bn.Serialize(writer);

            writer.Write(tn.BlockName);
            writer.Write(tn.BlockID);
            tn.Serialize(writer);

            writer.Write(unknown1);
            writer.Write((int)names.Length);
            for (int i = 0; i < names.Length; i++)
            {
                writer.Write(names[i]);
            }

            writer.Write(unknown2);
            writer.Write(unknown3);
            writer.Write(unknown4);
            writer.Write(unknown5);
        }
Example #3
0
        /// <summary>
        /// Serializes a the Attributes stored in this Instance to the BinaryStream
        /// </summary>
        /// <param name="writer">The Stream the Data should be stored to</param>
        /// <remarks>
        /// Be sure that the Position of the stream is Proper on
        /// return (i.e. must point to the first Byte after your actual File)
        /// </remarks>
        public override void Serialize(System.IO.BinaryWriter writer)
        {
            writer.Write(version);

            writer.Write(rn.BlockName);
            writer.Write(rn.BlockID);
            rn.Serialize(writer);

            writer.Write(bn.BlockName);
            writer.Write(bn.BlockID);
            bn.Serialize(writer);

            writer.Write(tn.BlockName);
            writer.Write(tn.BlockID);
            tn.Serialize(writer);

            writer.Write(unknown1);
            writer.Write(unknown2);
            writer.Write(name);
            writer.Write(unknown3);
            writer.Write(unknown4);

            writer.Write((uint)itemsa.Length);
            for (int i = 0; i < itemsa.Length; i++)
            {
                itemsa[i].Serialize(writer);
            }
            writer.Write(unknown5);

            writer.Write((uint)itemsb.Length);
            for (int i = 0; i < itemsb.Length; i++)
            {
                writer.Write(itemsb[i].Unknown1);
            }

            if (version == 0x15)
            {
                for (int i = 0; i < itemsb.Length; i++)
                {
                    writer.Write(itemsb[i].Name);
                }
            }

            writer.Write((int)data.Length);
            writer.Write(data);
            writer.Write(unknown6);
        }