/// <summary>Converts the stepper into an array.</summary> /// <typeparam name="T">The generic type of the stepper.</typeparam> /// <param name="stepper">The stepper to convert.</param> /// <returns>The array created from the stepper.</returns> public static T[] ToArray <T>(this Stepper <T> stepper) { int count = stepper.Count(); T[] elements = new T[count]; int i = 0; stepper((T step) => { elements[i++] = step; }); return(elements); }