public override string ToString() { string str = ""; int cost = 0; foreach (Weapon arme in Weapons) { str += arme + ", "; if (CostOverrides.Any(s => s.WeaponId == arme.Id)) { cost += CostOverrides.First(s => s.WeaponId == arme.Id).Cost; } else { cost += arme.Cost; } } if (str.Length > 2) { str = str.Substring(0, str.Length - 2); } if (cost > 0) { str += " (+" + cost + ")"; } return(str); }
public WarGearCombination Copy() { WarGearCombination conf = new WarGearCombination(); conf.Weapons.AddRange(Weapons); CostOverrides.AddRange(CostOverrides); return(conf); }