Table of Contents

Class ArrayExtensions

Namespace
Vintagestory.API.Util
Assembly
VintagestoryAPI.dll
public static class ArrayExtensions
Inheritance
ArrayExtensions
Inherited Members

Methods

Append<T>(T[], IEnumerable<T>)

Creates a new copy of the array with values appended to the end of the array

public static T[] Append<T>(this T[] array, IEnumerable<T> values)

Parameters

array T[]
values IEnumerable<T>

Returns

T[]

Type Parameters

T

Append<T>(T[], T)

Creates a new copy of the array with value appened to the end of the array

public static T[] Append<T>(this T[] array, T value)

Parameters

array T[]
value T

Returns

T[]

Type Parameters

T

Append<T>(T[], params T[])

Creates a new copy of the array with value appended to the end of the array

public static T[] Append<T>(this T[] array, params T[] value)

Parameters

array T[]
value T[]

Returns

T[]

Type Parameters

T

Contains<T>(T[], T)

public static bool Contains<T>(this T[] array, T value)

Parameters

array T[]
value T

Returns

bool

Type Parameters

T

Fill<T>(T[], fillCallback<T>)

public static T[] Fill<T>(this T[] originalArray, fillCallback<T> fillCallback)

Parameters

originalArray T[]
fillCallback fillCallback<T>

Returns

T[]

Type Parameters

T

Fill<T>(T[], T)

public static T[] Fill<T>(this T[] originalArray, T with)

Parameters

originalArray T[]
with T

Returns

T[]

Type Parameters

T

InRange<T>(T[], Func<T, double>, double)

public static List<T> InRange<T>(this T[] array, Func<T, double> getDistance, double range)

Parameters

array T[]
getDistance Func<T, double>
range double

Returns

List<T>

Type Parameters

T

IndexOf<T>(T[], Func<T, bool>)

public static int IndexOf<T>(this T[] array, Func<T, bool> predicate)

Parameters

array T[]
predicate Func<T, bool>

Returns

int

Type Parameters

T

IndexOf<T>(T[], T)

public static int IndexOf<T>(this T[] array, T value)

Parameters

array T[]
value T

Returns

int

Type Parameters

T

InsertAt<T>(T[], T, int)

Creates a new copy of the array with value inserted at the given index

public static T[] InsertAt<T>(this T[] array, T value, int index)

Parameters

array T[]
value T
index int

Returns

T[]

Type Parameters

T

Nearest<T>(T[], Func<T, double>)

public static T Nearest<T>(this T[] array, Func<T, double> getDistance)

Parameters

array T[]
getDistance Func<T, double>

Returns

T

Type Parameters

T

RemoveEntry<T>(T[], int)

public static T[] RemoveEntry<T>(this T[] array, int index)

Parameters

array T[]
index int

Returns

T[]

Type Parameters

T

Remove<T>(T[], T)

Creates a new copy of the array with value removed

public static T[] Remove<T>(this T[] array, T value)

Parameters

array T[]
value T

Returns

T[]

Type Parameters

T

Shuffle<T>(T[], Random)

Performs a Fisher-Yates shuffle in linear time or O(n)

public static T[] Shuffle<T>(this T[] array, Random rand)

Parameters

array T[]
rand Random

Returns

T[]

Type Parameters

T

Shuffle<T>(T[], LCGRandom)

Performs a Fisher-Yates shuffle in linear time or O(n)

public static T[] Shuffle<T>(this T[] array, LCGRandom rand)

Parameters

array T[]
rand LCGRandom

Returns

T[]

Type Parameters

T