/// <summary> /// Returns a random item from an array from index equal to or greater /// than 0 index and less than the maxIndex. If no array is supplied /// or if the index is outside of the range if the array, default(T) is return /// </summary> /// <typeparam name="T"></typeparam> /// <param name="r"></param> /// <param name="items"></param> /// <param name="maxIndex"></param> /// <returns></returns> public static T NextItem <T>(this IRandomizer r, T[] items, int maxIndex) => r.NextItem(items, 0, maxIndex);
/// <summary> /// Returns a random item from an array from index equal to or greater /// than 0 index and less than the length of the array. If no array is supplied /// or if the index is outside of the range if the array, default(T) is return /// </summary> /// <typeparam name="T"></typeparam> /// <param name="r"></param> /// <param name="items"></param> /// <returns></returns> public static T NextItem <T>(this IRandomizer r, T[] items) => r.NextItem(items, 0, items?.Length ?? 0);