예제 #1
0
        protected virtual void Parse(Stream s)
        {
            BinaryReader r = new BinaryReader(s);

            this.version         = r.ReadUInt32();
            this.catalogVersion  = r.ReadUInt32();
            this.catalogNameHash = r.ReadUInt32();
            this.catalogDescHash = r.ReadUInt32();
            this.catalogPrice    = r.ReadUInt32();

            this.catalogUnknown1 = r.ReadUInt32();
            this.catalogUnknown2 = r.ReadUInt32();
            this.catalogUnknown3 = r.ReadUInt32();
            byte count = r.ReadByte();

            TGIBlock[] tgiLIst = new TGIBlock[count];
            for (int i = 0; i < count; i++)
            {
                tgiLIst[i] = new TGIBlock(RecommendedApiVersion, OnResourceChanged, "ITG", s);
            }
            this.catalogStyleTGIList = new CountedTGIBlockList(OnResourceChanged, tgiLIst);

            this.catalogUnknown4 = r.ReadUInt16();
            var count2 = r.ReadInt32();

            this.catalogTagList = new SimpleList <ushort>(OnResourceChanged);
            for (var i = 0; i < count2; i++)
            {
                this.catalogTagList.Add(r.ReadUInt16());
            }
            this.catalogSellingPointList = new SellingPointList(OnResourceChanged, s);
            this.catalogUnknown5         = r.ReadUInt64();
            this.catalogUnknown6         = r.ReadUInt16();
            this.catalogUnknown7         = r.ReadUInt64();
        }
예제 #2
0
        protected override Stream UnParse()
        {
            MemoryStream ms = new MemoryStream();
            BinaryWriter w  = new BinaryWriter(ms);

            w.Write(this.version);
            w.Write(this.catalogVersion);
            w.Write(this.catalogNameHash);
            w.Write(this.catalogDescHash);
            w.Write(this.catalogPrice);
            w.Write(this.catalogUnknown1);
            w.Write(this.catalogUnknown2);
            w.Write(this.catalogUnknown3);
            if (this.catalogStyleTGIList == null)
            {
                this.catalogStyleTGIList = new CountedTGIBlockList(OnResourceChanged);
            }
            w.Write((byte)this.catalogStyleTGIList.Count);
            foreach (var tgi in this.catalogStyleTGIList)
            {
                tgi.UnParse(ms);
            }

            w.Write(this.catalogUnknown4);
            if (this.catalogTagList == null)
            {
                this.catalogTagList = new SimpleList <ushort>(OnResourceChanged);
            }
            w.Write(this.catalogTagList.Count);
            foreach (var i in this.catalogTagList)
            {
                w.Write(i);
            }
            if (this.catalogSellingPointList == null)
            {
                this.catalogSellingPointList = new SellingPointList(OnResourceChanged);
            }
            this.catalogSellingPointList.UnParse(ms);
            w.Write(this.catalogUnknown5);
            w.Write(this.catalogUnknown6);
            w.Write(this.catalogUnknown7);
            return(ms);
        }
예제 #3
0
        public void MakeNew()
        {
            this.commonBlockVersion = 0x9;
            this.nameHash           = 0;
            this.descriptionHash    = 0;
            this.price       = 0;
            this.unkCommon01 = 0;
            this.unkCommon02 = 0;
            this.unkCommon03 = 0;
            int tgi_count = 0;

            this.productStyles  = new CountedTGIBlockList(handler, TGIBlock.Order.ITG, tgi_count);
            this.unkCommon04    = 0;
            this.tagList        = new CatalogTagList(handler);
            this.sellingPoints  = new SellingPointList(handler);
            this.unlockByHash   = 0;
            this.unlockedByHash = 0;
            this.unkCommon06    = 0xffff;
            this.unkCommon07    = 0;
        }
예제 #4
0
 public CatalogCommon(int APIversion, EventHandler handler, uint commonBlockVersion, uint nameHash, uint descriptionHash,
                      uint price, uint unkCommon01, uint unkCommon02, uint unkCommon03, CountedTGIBlockList productStyles, UInt16 unkCommon04,
                      CatalogTagList tagList, SellingPointList sellingPoints, uint unlockByHash, uint unlockedByHash, UInt16 unkCommon06, ulong unkCommon07)
     : base(APIversion, handler)
 {
     this.handler            = handler;
     this.commonBlockVersion = commonBlockVersion;
     this.nameHash           = nameHash;
     this.descriptionHash    = descriptionHash;
     this.price          = price;
     this.unkCommon01    = unkCommon01;
     this.unkCommon02    = unkCommon02;
     this.unkCommon03    = unkCommon03;
     this.productStyles  = new CountedTGIBlockList(handler, TGIBlock.Order.ITG, productStyles);
     this.unkCommon04    = unkCommon04;
     this.tagList        = new CatalogTagList(handler, tagList);
     this.sellingPoints  = new SellingPointList(handler, sellingPoints);
     this.unlockByHash   = unlockByHash;
     this.unlockedByHash = unlockedByHash;
     this.unkCommon06    = unkCommon06;
     this.unkCommon07    = unkCommon07;
 }
예제 #5
0
        void Parse(Stream s)
        {
            var br = new BinaryReader(s);

            this.commonBlockVersion = br.ReadUInt32();
            this.nameHash           = br.ReadUInt32();
            this.descriptionHash    = br.ReadUInt32();
            this.price       = br.ReadUInt32();
            this.unkCommon01 = br.ReadUInt32();
            this.unkCommon02 = br.ReadUInt32();
            this.unkCommon03 = br.ReadUInt32();
            int tgi_count = br.ReadByte();

            this.productStyles  = new CountedTGIBlockList(handler, TGIBlock.Order.ITG, tgi_count, s);
            this.unkCommon04    = br.ReadUInt16();
            this.tagList        = new CatalogTagList(handler, s);
            this.sellingPoints  = new SellingPointList(handler, s);
            this.unlockByHash   = br.ReadUInt32();
            this.unlockedByHash = br.ReadUInt32();
            this.unkCommon06    = br.ReadUInt16();
            this.unkCommon07    = br.ReadUInt64();
        }