Skip to Main Content

BTD_Mod_Helper​.Extensions​.IEnumerableExt


BloonsTD6 Mod Helper

BTD_Mod_Helper.Extensions

IEnumerableExt Class

Extensions for the normal System IEnumerable class

public static class IEnumerableExt

Inheritance System.Object  IEnumerableExt

Methods

IEnumerableExt.ArgMax<T,K>(this IEnumerable, Func<T,K>, IComparer) Method

Returns the argument that maximizes the given value

public static T ArgMax<T,K>(this System.Collections.Generic.IEnumerable<T> source, System.Func<T,K> map=null, System.Collections.Generic.IComparer<K> comparer=null);

Type parameters

T

K

Parameters

source System.Collections.Generic.IEnumerable<T>

map System.Func<T,K>

comparer System.Collections.Generic.IComparer<K>

Returns

T

IEnumerableExt.CastAll<TSource,TCast>(this IEnumerable) Method

Casts a reference array to an IEnumerable of a different Il2cpptype.


Objects that aren't of the specified type will end up as null in the result

public static System.Collections.Generic.IEnumerable<TCast> CastAll<TSource,TCast>(this System.Collections.Generic.IEnumerable<TSource> list)
    where TSource : Object
    where TCast : Object;

Type parameters

TSource

TCast

Parameters

list System.Collections.Generic.IEnumerable<TSource>

Returns

System.Collections.Generic.IEnumerable<TCast>

IEnumerableExt.Deconstruct<K,V>(this IGrouping<K,V>, K, List) Method

Deconstruct IGrouping to list

public static void Deconstruct<K,V>(this System.Linq.IGrouping<K,V> grouping, out K k, out System.Collections.Generic.List<V> v);

Type parameters

K

V

Parameters

grouping System.Linq.IGrouping<K,V>

k K

v System.Collections.Generic.List<V>

IEnumerableExt.OfIl2CppType(this IEnumerable) Method

Filters the elements of the IEnumerable by if their Il2Cpp type is T

public static System.Collections.Generic.IEnumerable<T> OfIl2CppType<T>(this System.Collections.IEnumerable ienumerable)
    where T : Il2CppObjectBase;

Type parameters

T

The Il2Cpp type to filter by

Parameters

ienumerable System.Collections.IEnumerable

Returns

System.Collections.Generic.IEnumerable<T>

IEnumerableExt.Repeat(this IEnumerable, int) Method

Repeats each element in the sequence n times, keeping the same order of elements

public static System.Collections.Generic.IEnumerable<T> Repeat<T>(this System.Collections.Generic.IEnumerable<T> enumerable, int n);

Type parameters

T

Parameters

enumerable System.Collections.Generic.IEnumerable<T>

n System.Int32

Returns

System.Collections.Generic.IEnumerable<T>

IEnumerableExt.ToIl2CppList(this IEnumerable) Method

Return as Il2CppSystem.List

public static List<T> ToIl2CppList<T>(this System.Collections.Generic.IEnumerable<T> enumerable);

Type parameters

T

Parameters

enumerable System.Collections.Generic.IEnumerable<T>

Returns

Il2CppSystem.Collections.Generic.List

IEnumerableExt.ToIl2CppReferenceArray(this IEnumerable) Method

Return as Il2CppReferenceArray

public static Il2CppReferenceArray<T> ToIl2CppReferenceArray<T>(this System.Collections.Generic.IEnumerable<T> enumerable)
    where T : Object;

Type parameters

T

Parameters

enumerable System.Collections.Generic.IEnumerable<T>

Returns

Il2CppInterop.Runtime.InteropTypes.Arrays.Il2CppReferenceArray

IEnumerableExt.ToLockList(this IEnumerable) Method

Return as LockList

public static LockList<T> ToLockList<T>(this System.Collections.Generic.IEnumerable<T> enumerable);

Type parameters

T

Parameters

enumerable System.Collections.Generic.IEnumerable<T>

Returns

Il2CppAssets.Scripts.Utils.LockList

To learn how to download BTD Mod Helper and install mods, click here