private void ValueButton_Click(object sender, RoutedEventArgs e) { foreach (UniqueBase equipment in Uniques) { EquipBaseFields.CalculateArmorValues(equipment); } }
private void ReqButton_Click(object sender, RoutedEventArgs e) { foreach (EquipmentBase equipment in Equipments) { EquipBaseFields.CalculateReqValues(equipment); } }
private void CreateHybrid(EquipmentBase item, string oldVal, string newVal, GroupType group) { EquipmentBase hybrid = Helpers.DeepClone(item); hybrid.IdName = hybrid.IdName.Replace(oldVal, newVal); if (Equipments.ToList().Find(x => x.IdName == hybrid.IdName) != null) { return; } hybrid.Group = group; EquipBaseFields.CalculateArmorValues(hybrid); EquipBaseFields.CalculateReqValues(hybrid); Equipments.Add(hybrid); }
private void CreateOtherArmorsButton_Click(object sender, RoutedEventArgs e) { if (EquipList.SelectedItem == null || EquipList.SelectedItems.Count == 0) { return; } foreach (EquipmentBase item in EquipList.SelectedItems) { if (item.EquipSlot != EquipSlotType.BODY_ARMOR) { continue; } EquipmentBase helm = Helpers.DeepClone(item); helm.IdName = helm.IdName.Replace("Armor", "Helm"); helm.EquipSlot = EquipSlotType.HEADGEAR; EquipBaseFields.CalculateArmorValues(helm); EquipBaseFields.CalculateReqValues(helm); Equipments.Add(helm); EquipmentBase boots = Helpers.DeepClone(item); boots.IdName = boots.IdName.Replace("Armor", "Boots"); boots.EquipSlot = EquipSlotType.BOOTS; EquipBaseFields.CalculateArmorValues(boots); EquipBaseFields.CalculateReqValues(boots); Equipments.Add(boots); EquipmentBase gloves = Helpers.DeepClone(item); gloves.IdName = gloves.IdName.Replace("Armor", "Gloves"); gloves.EquipSlot = EquipSlotType.GLOVES; EquipBaseFields.CalculateArmorValues(gloves); EquipBaseFields.CalculateReqValues(gloves); Equipments.Add(gloves); } }