public List <PivotFightResultSet> GetColumnTotals() { var ret = new List <PivotFightResultSet>(); for (int i = 0; i < PivotGroup2.Count; i++) { PivotFightResultSet[] row = GetColumn(i); PivotFightResultSet set = PivotFightResultSet.CombineMany(row); ret.Add(set); } return(ret); }
public static PivotFightResultSet Combine(PivotFightResultSet first, PivotFightResultSet second) { Dictionary <FightResultBase, int> dict = first.Results.ToDictionary(r => r.Key, r => r.Value); foreach (var v in second.Results) { if (dict.ContainsKey(v.Key)) { dict[v.Key] += v.Value; } else { dict[v.Key] = v.Value; } } return(new PivotFightResultSet(dict)); }