public Dictionary <Enemy, Dictionary <Element, ElementalRes> > GetElementResists() { Dictionary <Enemy, Dictionary <Element, ElementalRes> > dict = new Dictionary <Enemy, Dictionary <Element, ElementalRes> >(); foreach (DataRow row in dataTable.Rows) { Enemy enemy = Enemies.enemies.Find(e => e.ID == row.Field <string>(0)); Dictionary <Element, ElementalRes> vals = new Dictionary <Element, ElementalRes>(); for (int i = 0; i < 8; i++) { string res = row.Field <string>(3 + 2 * i); if (res != "???") { vals.Add((Element)i, DataExtensions.GetEnumValue <ElementalRes>(res)); } } if (vals.Count > 0) { dict.Add(enemy, vals); } } return(dict); }