TwigExtensionMethods

public static class TwigExtensionMethods

Methods

Cycle<T>

#Example
Cycle all the items and metas in a twig until the item at the given index is the first item in the twig.
public static Twig<T> Cycle<T>(
this Twig<T>
twig,
newStartIndex
)

GetNonNullIndex

#Example
Find the twig index which is associated with the i-th non-null item index.
public static int GetNonNullIndex(
this ITwig
twig,
targetNonNullIndex
)

ItemsBackwards<T>

#Example
Enumerate backwards over all non-null items in a twig starting at a given offset.
public static IEnumerable<T> ItemsBackwards<T>(
this Twig<T>
twig,
Twig to iterate over.
firstIndex
Initial index.
)

ItemsForwards<T>

#Example
Enumerate forwards over all non-null items in a twig starting at a given offset.
public static IEnumerable<T> ItemsForwards<T>(
this Twig<T>
twig,
Twig to iterate over.
firstIndex
Initial index.
)

NonNullIndices

#Example
Get an array containing all the indices of non-null items in the twig.
public static int[] NonNullIndices(
this ITwig
twig
)

PearsBackwards<T>

#Example
Enumerate backwards over all non-null items in a twig starting at a given offset.
public static IEnumerable<Pear<T>> PearsBackwards<T>(
this Twig<T>
twig,
Twig to iterate over.
firstIndex
Initial index.
)

PearsForwards<T>

#Example
Enumerate forwards over all non-null items in a twig starting at a given offset.
public static IEnumerable<Pear<T>> PearsForwards<T>(
this Twig<T>
twig,
Twig to iterate over.
firstIndex
Initial index.
)

TypeOverlap

#Example
Resolve the type overlap for all types (minus all nulls) in a twig.
public static TypeOverlap TypeOverlap(
this ITwig
twig
)
Type overlap or null if there are no actual values in the twig.