public IngredientRecordData(System.IO.BinaryReader reader)
        {
            weight = reader.ReadSingle();
            value  = reader.ReadInt32();

            var magicEffects = new List <MagicEffectRecord>();

            for (var i = 0; i < 4; i++)
            {
                var magicEffectType = (MagicEffectType)reader.ReadInt32();

                if (magicEffectType == MagicEffectType.None)
                {
                    continue;
                }

                var magicEffectRecord = MagicEffectRecord.Get(magicEffectType);
                magicEffects.Add(magicEffectRecord);
            }

            this.magicEffects = magicEffects.ToArray();

            characterSkills = new CharacterSkill[4];
            for (var i = 0; i < characterSkills.Length; i++)
            {
                characterSkills[i] = (CharacterSkill)reader.ReadInt32();
            }

            characterAttributes = new CharacterAttribute[4];
            for (var i = 0; i < characterAttributes.Length; i++)
            {
                characterAttributes[i] = (CharacterAttribute)reader.ReadInt32();
            }
        }
Esempio n. 2
0
 public EnchantmentEffect(System.IO.BinaryReader reader)
 {
     magicEffect        = MagicEffectRecord.Get((MagicEffectType)reader.ReadInt16());
     characterSkill     = (CharacterSkill)reader.ReadByte();
     characterAttribute = (CharacterAttribute)reader.ReadByte();
     rangeType          = (RangeType)reader.ReadInt32();
     area         = reader.ReadInt32();
     duration     = reader.ReadInt32();
     minMagnitude = reader.ReadInt32();
     maxMagnitude = reader.ReadInt32();
 }