Table of Contents

Class IntRangeExtensions

Namespace
PAC.Extensions

Extension methods involving IntRange.

public static class IntRangeExtensions
Inheritance
IntRangeExtensions
Inherited Members

Methods

GetRange<T>(IReadOnlyList<T>, IntRange)

Lazily iterates over the indices in the IntRange and yields the IReadOnlyList<T>'s element at that position.

public static IEnumerable<T> GetRange<T>(this IReadOnlyList<T> list, IntRange indices)

Parameters

list IReadOnlyList<T>
indices IntRange

The range of indices to iterate over.

Returns

IEnumerable<T>

Type Parameters

T

Exceptions

ArgumentNullException

list is empty.

Next(Random, IntRange)

Returns a random integer within the given range.

public static int Next(this Random random, IntRange range)

Parameters

random Random
range IntRange

Returns

int

Random(Random, IntRange)

Creates an infinite random sequence.

public static IEnumerable<int> Random(Random random, IntRange range)

Parameters

random Random
range IntRange

Returns

IEnumerable<int>