public static IEnumerable <Attack> GetDamages(this Api_Support_Hourai support, int supportType) { // supportType = 2 -> isCritical = 1 // supportType = 3 -> isCritical = 2 var criticalFlag = supportType - 1; return(support.api_damage .Select((damage, index) => new { target = ToIndex(index, FleetType.Enemy) - 1, damage = Convert.ToInt32(damage), critical = support.api_cl_list[index] }) .GetData() .Select((x, i) => new Attack(0, x.target, x.damage, x.critical == criticalFlag))); }