예제 #1
0
        public void Serialize(ushort version, Stream output, Endian endian)
        {
            output.WriteStringU32(this.Tag, endian);

            if (version >= 3)
            {
                output.WriteValueU8((byte)(this.Unk1 ? 1 : 0));
            }

            output.WriteStringU32(this.Name, endian);

            if (version >= 2)
            {
                output.WriteValueU8((byte)(this.Unk3 ? 1 : 0));
            }

            if (this.Unk3 == false)
            {
                XmlResource0.Serialize(output, this.Content, endian);
            }
            else
            {
                XmlResource1.Serialize(output, this.Content, endian);
            }
        }
예제 #2
0
        public void Serialize(ushort version, Stream output, Endian endian)
        {
            output.WriteStringU32(this.Tag, endian);

            if (version >= 3)
            {
                output.WriteValueU8((byte)(this.Unk1 ? 1 : 0));
            }

            output.WriteStringU32(this.Name, endian);

            if (version >= 2)
            {
                output.WriteValueU8((byte)(this.Unk3 ? 1 : 0));
            }
            if (this.Unk3 == false)
            {
                if (!bFailedToDecompile)
                {
                    XmlResource0.Serialize(output, this.Content, endian);
                }
                else
                {
                    byte[] data = File.ReadAllBytes(this.Content);
                    output.WriteBytes(data);
                }
            }
            else
            {
                XmlResource1.Serialize(output, this.Content, endian);
            }
        }