Exemple #1
0
            public void UnParse(Stream s)
            {
                BinaryWriter w = new BinaryWriter(s);

                w.Write(unknown1);
                unknown2.UnParse(s);
                w.Write((byte)indexList.Count);
                foreach (byte b in indexList)
                {
                    w.Write(b);
                }
            }
        protected override Stream UnParse()
        {
            MemoryStream ms = new MemoryStream();
            BinaryWriter w  = new BinaryWriter(ms);

            w.Write(this.version);
            long tgiOffsetPosition = ms.Position;

            w.Write(0);
            w.Write(unknown1);
            w.Write(unknown2);
            w.Write(unknown3);
            w.Write(unknown4);
            w.Write(unknown5);
            w.Write(unknown6);
            w.Write(unknown7);
            w.Write(unknown8);
            w.Write((uint)age);
            w.Write((uint)gender);
            w.Write(skinToneReference);
            w.Write((byte)this.unknown9.Count);
            foreach (var value in this.unknown9)
            {
                w.Write(value);
            }
            sliderReferences1.UnParse(ms);
            sliderReferences2.UnParse(ms);
            unknown10.UnParse(ms);
            this.unknown11.UnParse(ms);

            w.Write((byte)this.unknownByteList.Count);
            foreach (var i in this.unknownByteList)
            {
                w.Write(i);
            }

            sliderReferences3.UnParse(ms);
            sliderReferences4.UnParse(ms);

            unknown12.UnParse(ms);
            sliderReferences5.UnParse(ms);

            this.unknown13.UnParse(ms);
            w.Write(this.caspReference);
            w.Write((byte)this.dataReferenceList.Count);
            foreach (var i in this.dataReferenceList)
            {
                w.Write(i);
            }

            long tmpPostion = ms.Position;

            ms.Position = tgiOffsetPosition;
            w.Write((uint)tmpPostion - 8);
            ms.Position = tmpPostion;
            w.Write((byte)tgiList.Count);
            foreach (var tgi in this.tgiList)
            {
                w.Write(tgi.Instance);
                w.Write(tgi.ResourceGroup);
                w.Write(tgi.ResourceType);
            }

            ms.Position = 0;
            return(ms);
        }