public modLists.SimpleList<string[]> GetRowsWithValue(modLists.SimpleList<string[]> TextLines, string Value) { IEnumerator enumerator; modLists.SimpleList<string[]> list2 = new modLists.SimpleList<string[]>(); try { enumerator = TextLines.GetEnumerator(); while (enumerator.MoveNext()) { string[] current = (string[]) enumerator.Current; if (current[0] == Value) { list2.Add(current); } } } finally { if (enumerator is IDisposable) { (enumerator as IDisposable).Dispose(); } } return list2; }
public static Position.XY_dbl CalcUnitsCentrePos(modLists.SimpleList<clsMap.clsUnit> Units) { Position.XY_dbl _dbl2; IEnumerator enumerator; _dbl2.X = 0.0; _dbl2.Y = 0.0; try { enumerator = Units.GetEnumerator(); while (enumerator.MoveNext()) { clsMap.clsUnit current = (clsMap.clsUnit) enumerator.Current; _dbl2 += current.Pos.Horizontal.ToDoubles(); } } finally { if (enumerator is IDisposable) { (enumerator as IDisposable).Dispose(); } } return (Position.XY_dbl) (_dbl2 / ((double) Units.Count)); }