예제 #1
0
        /// <summary>
        /// Unserializes a BinaryStream into the Attributes of this Instance
        /// </summary>
        /// <param name="reader">The Stream that contains the FileData</param>
        protected override void Unserialize(System.IO.BinaryReader reader)
        {
            version = reader.ReadUInt32();

            if (version >= 0x05)
            {
                lifewants = new WantItem[reader.ReadUInt32()];
                for (int i = 0; i < lifewants.Length; i++)
                {
                    lifewants[i] = new WantItem(provider);
                    lifewants[i].Unserialize(reader);
                }

                maxwants = reader.ReadUInt32();
            }
            else
            {
                maxwants  = 4;
                lifewants = new WantItem[0];
            }

            wants = new WantItem[reader.ReadUInt32()];
            for (int i = 0; i < wants.Length; i++)
            {
                wants[i] = new WantItem(provider);
                wants[i].Unserialize(reader);
            }

            if (version >= 0x05)
            {
                maxfears = reader.ReadUInt32();
            }
            else
            {
                maxfears = 3;
            }

            fears = new WantItem[reader.ReadUInt32()];
            for (int i = 0; i < fears.Length; i++)
            {
                fears[i] = new WantItem(provider);
                fears[i].Unserialize(reader);
            }

            if (version >= 0x05)
            {
                unknown5 = reader.ReadUInt32();
            }
            unknown1 = reader.ReadUInt32();
            unknown2 = reader.ReadUInt32();

            items = new WantItemContainer[reader.ReadUInt32()];
            for (int i = 0; i < items.Length; i++)
            {
                items[i] = new WantItemContainer(provider);
                items[i].Unserialize(reader);
            }

            overhead = reader.ReadBytes((int)(reader.BaseStream.Length - reader.BaseStream.Position));
        }
예제 #2
0
        /// <summary>
        /// Unserializes a BinaryStream into the Attributes of this Instance
        /// </summary>
        /// <param name="reader">The Stream that contains the FileData</param>
        public void Unserialize(System.IO.BinaryReader reader)
        {
            guid  = reader.ReadUInt32();
            items = new WantItem[reader.ReadUInt32()];

            for (int i = 0; i < items.Length; i++)
            {
                items[i] = new WantItem(provider);
                items[i].Unserialize(reader);
            }
        }