Пример #1
0
        protected override Stream UnParse()
        {
            var s  = new MemoryStream();
            var bw = new BinaryWriter(s);

            bw.Write(this.version);
            if (this.commonA == null)
            {
                this.commonA = new CatalogCommon(kRecommendedApiVersion, this.OnResourceChanged);
            }
            this.commonA.UnParse(s);
            bw.Write(this.hashIndicator);
            bw.Write(this.hash01);
            bw.Write(this.hash02);
            bw.Write(this.hash03);
            if (this.refList == null)
            {
                this.refList = new CSTR_references(kRecommendedApiVersion, this.OnResourceChanged);
            }
            this.refList.UnParse(s);
            bw.Write(this.unk01);
            bw.Write(this.unk02);
            bw.Write(this.unk03);
            bw.Write(this.materialVariant);
            bw.Write(this.swatchGrouping);
            if (this.colors == null)
            {
                this.colors = new ColorList(this.OnResourceChanged);
            }
            this.colors.UnParse(s);
            bw.Write(this.unk05);
            return(s);
        }
Пример #2
0
        void Parse(Stream s)
        {
            var br = new BinaryReader(s);

            this.version         = br.ReadUInt32();
            this.commonA         = new CatalogCommon(kRecommendedApiVersion, this.OnResourceChanged, s);
            this.hashIndicator   = br.ReadUInt32();
            this.hash01          = br.ReadUInt32();
            this.hash02          = br.ReadUInt32();
            this.hash03          = br.ReadUInt32();
            this.refList         = new CSTR_references(kRecommendedApiVersion, this.OnResourceChanged, s);
            this.unk01           = br.ReadByte();
            this.unk02           = br.ReadByte();
            this.unk03           = br.ReadByte();
            this.materialVariant = br.ReadUInt32();
            this.swatchGrouping  = br.ReadUInt64();
            this.colors          = new ColorList(this.OnResourceChanged, s);
            this.unk05           = br.ReadByte();
        }