Ejemplo n.º 1
0
 public void Save()
 {
     using (BinaryWriter writer = new BinaryWriter(File.Open(ItemConfigPath, FileMode.Create)))
     {
         writer.Write((ushort)ItemChanges.Count);
         for (int i = 0; i < ItemChanges.Count; i++)
         {
             // 57 Bytes and 4 bits
             ItemProperties changes = ItemChanges[i];
             writer.Write((ushort)changes.Type);
             writer.Write(changes.AutoReuse);
             writer.Write(changes.Consumable);
             writer.Write(changes.Potion);
             writer.Write(changes.Accessory);
             writer.Write((byte)changes.DamageType);
             writer.Write(changes.Damage);
             writer.Write(changes.KnockBack);
             writer.Write((ushort)changes.Crit);
             writer.Write((ushort)changes.Shoot);
             writer.Write(changes.ShootSpeed);
             writer.Write((ushort)changes.CreateTile);
             writer.Write((sbyte)changes.TileBoost);
             writer.Write((ushort)changes.BuffType);
             writer.Write(changes.BuffTime);
             writer.Write((ushort)changes.HealLife);
             writer.Write((ushort)changes.HealMana);
             writer.Write((ushort)changes.Axe);
             writer.Write((ushort)changes.Pickaxe);
             writer.Write((ushort)changes.Hammer);
             writer.Write(changes.MaxStack);
             writer.Write((ushort)changes.UseAnimation);
             writer.Write((ushort)changes.UseTime);
             writer.Write(changes.Defense);
             writer.Write((ushort)changes.FishingPole);
             writer.Write(changes.Scale);
             writer.Write((byte)changes.UseStyle);
             writer.Write((ushort)changes.CostMP);
         }
     }
 }