Beispiel #1
0
        public static void Write(this BinaryWriter writer, EnchantmentRegistry registry)
        {
            var enchantmentMask = registry.EnchantmentMask;

            writer.Write((uint)enchantmentMask);
            if (enchantmentMask.HasFlag(EnchantmentMask.LifeSpells))
            {
                writer.Write(registry.LifeSpells);
            }
            if (enchantmentMask.HasFlag(EnchantmentMask.CreatureSpells))
            {
                writer.Write(registry.CreatureSpells);
            }
            if (enchantmentMask.HasFlag(EnchantmentMask.Cooldown))
            {
                writer.Write(registry.Cooldowns);
            }
            if (enchantmentMask.HasFlag(EnchantmentMask.Vitae))
            {
                writer.Write(registry.Vitae);
            }
        }
        public static void Write(this BinaryWriter writer, EnchantmentRegistry registry)
        {
            var enchantmentMask = registry.EnchantmentMask;

            writer.Write((uint)enchantmentMask);
            if (enchantmentMask.HasFlag(EnchantmentMask.Multiplicative))
            {
                writer.Write(registry.Enchantments[EnchantmentMask.Multiplicative]);
            }
            if (enchantmentMask.HasFlag(EnchantmentMask.Additive))
            {
                writer.Write(registry.Enchantments[EnchantmentMask.Additive]);
            }
            if (enchantmentMask.HasFlag(EnchantmentMask.Cooldown))
            {
                writer.Write(registry.Enchantments[EnchantmentMask.Cooldown]);
            }
            if (enchantmentMask.HasFlag(EnchantmentMask.Vitae))
            {
                writer.Write(registry.Enchantments[EnchantmentMask.Vitae].FirstOrDefault());
            }
        }