Exemplo n.º 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(slb.BlockName);
            writer.Write(slb.BlockID);
            slb.Serialize(writer);

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

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

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

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

            writer.Write(unknown2);
            writer.Write(unknown3);
            writer.Write(unknown4);
            writer.Write(red);
            writer.Write(green);
            writer.Write(blue);
        }
Exemplo n.º 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(ogn.BlockName);
            writer.Write(ogn.BlockID);
            ogn.Serialize(writer);

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

            if (version == 0x0b)
            {
                writer.Write(unknown1);
            }

            if ((version == 0x0b) || (version == 0x0c))
            {
                writer.Write(unknown2);
                writer.Write(unknown3);
            }

            writer.Write((int)data.Length);
            for (int i = 0; i < data.Length; i++)
            {
                writer.Write(data[i].BlockID);
                Parent.WriteBlock(data[i], writer);
            }
        }
Exemplo n.º 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(typecode);

            if (typecode == 0x01)
            {
                writer.Write(sgres.BlockName);
                writer.Write(sgres.BlockID);
                sgres.Serialize(writer);

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

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

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

                writer.Write(unknown1);
            }
            else if (typecode == 0x00)
            {
                writer.Write(ogn.BlockName);
                writer.Write(ogn.BlockID);
                ogn.Serialize(writer);

                if (items.Length < 1)
                {
                    items = new ResourceNodeItem[1];
                }
                items[0].Serialize(writer);
            }
            else
            {
                throw new Exception("Unknown ResourceNode 0x" + Helper.HexString(version) + ", 0x" + Helper.HexString(typecode));
            }
            writer.Write(unknown2);
        }
Exemplo n.º 4
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(ctn.BlockName);
            writer.Write(ctn.BlockID);
            ctn.Serialize(writer);

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

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

            trans.Order = VectorTransformation.TransformOrder.TranslateRotate;
            trans.Serialize(writer);

            writer.Write(unknown);
        }
Exemplo n.º 5
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(sgres.Register(null));
            writer.Write(sgres.BlockID);
            sgres.Serialize(writer);

            writer.Write(refnode.Register(null));
            writer.Write(refnode.BlockID);
            refnode.Serialize(writer);

            writer.Write(ogn.Register(null));
            writer.Write(ogn.BlockID);
            ogn.Serialize(writer);

            if (version != 0x06)
            {
                writer.Write((uint)unknown.Length);
                for (int i = 0; i < unknown.Length; i++)
                {
                    writer.Write(unknown[i]);
                }
            }

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


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