List <AffixDisplayInformation> AddToAffixList(List <AffixDisplayInformation> list, SecondaryStats stat, ItemAffix affix) { bool existsInList = false; foreach (AffixDisplayInformation info in list) { if (info.secondary != null && info.secondary == stat && info.type == affix.GetModType()) { info.value += affix.GetValue(stat, item.ItemLevel, item.VarianceSeed); existsInList = true; } } if (!existsInList) { AffixDisplayInformation info = new AffixDisplayInformation(); info.secondary = stat; info.value = affix.GetValue(stat, item.ItemLevel, item.VarianceSeed); info.type = affix.GetModType(); list.Add(info); } return(list); }