Esempio n. 1
0
        /// <summary>
        /// Loads and parses the provided data.
        /// </summary>
        /// <param name="data">Data.</param>
        public override void LoadData(byte[] data)
        {
            if (this.Version == WarcraftVersion.Unknown)
            {
                throw new InvalidOperationException("The record data cannot be loaded before SetVersion has been called.");
            }

            using (MemoryStream ms = new MemoryStream(data))
            {
                using (BinaryReader br = new BinaryReader(ms))
                {
                    this.ID = br.ReadUInt32();
                    this.Name = new StringReference(br.ReadUInt32());

                    this.Type = (LiquidType)br.ReadInt32();

                    this.SpellEffect = new UInt32ForeignKey(SpellRecord.RecordName, "ID", br.ReadUInt32());
                }
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Loads and parses the provided data.
        /// </summary>
        /// <param name="data">Data.</param>
        public override void LoadData(byte[] data)
        {
            if (this.Version == WarcraftVersion.Unknown)
            {
                throw new InvalidOperationException("The record data cannot be loaded before SetVersion has been called.");
            }

            using (MemoryStream ms = new MemoryStream(data))
            {
                using (BinaryReader br = new BinaryReader(ms))
                {
                    this.ID = br.ReadUInt32();
                    this.Name = new StringReference(br.ReadUInt32());

                    if (this.Version >= WarcraftVersion.Warlords)
                    {
                        this.WeaponFlags = (WeaponAnimationFlags)br.ReadUInt32();
                        this.BodyFlags = br.ReadUInt32();
                    }

                    this.Flags = br.ReadUInt32();

                    this.FallbackAnimation = new UInt32ForeignKey(RecordName, "ID", br.ReadUInt32());
                    this.BehaviourAnimation = new UInt32ForeignKey(RecordName, "ID", br.ReadUInt32());

                    if (this.Version >= WarcraftVersion.Wrath)
                    {
                        this.BehaviourTier = br.ReadUInt32();
                    }
                }
            }
        }