Skip to Main Content

BTD_Mod_Helper​.Extensions​.Il2CppGenericsExt


BloonsTD6 Mod Helper

BTD_Mod_Helper.Extensions

Il2CppGenericsExt Class

Extensions for generic il2cpp lists

public static class Il2CppGenericsExt

Inheritance System.Object  Il2CppGenericsExt

Methods

Il2CppGenericsExt.Duplicate(this List) Method

Return a duplicate of this List

public static List<T> Duplicate<T>(this List<T> list);

Type parameters

T

Parameters

list Il2CppSystem.Collections.Generic.List

Returns

Il2CppSystem.Collections.Generic.List

Il2CppGenericsExt.DuplicateAs<TSource,TCast>(this List) Method

Return a duplicate of this list as type TCast

public static List<TCast> DuplicateAs<TSource,TCast>(this List<TSource> list)
    where TSource : Object
    where TCast : Object;

Type parameters

TSource

TCast

Parameters

list Il2CppSystem.Collections.Generic.List

Returns

Il2CppSystem.Collections.Generic.List

Il2CppGenericsExt.Get(this List, int) Method

Gets the item at the specified index. Circumvents "ambiguous indexer" warnings

public static T Get<T>(this List<T> list, int index);

Type parameters

T

Parameters

list Il2CppSystem.Collections.Generic.List

index System.Int32

Returns

T

Il2CppGenericsExt.GetItemOfType<TSource,TCast>(this List) Method

Return the first item of type TCast

public static TCast GetItemOfType<TSource,TCast>(this List<TSource> list)
    where TSource : Object
    where TCast : Object;

Type parameters

TSource

TCast

The Type of the Item you want

Parameters

list Il2CppSystem.Collections.Generic.List

Returns

TCast

Il2CppGenericsExt.GetItemsOfType<TSource,TCast>(this List) Method

Return all Items of type TCast

public static List<TCast> GetItemsOfType<TSource,TCast>(this List<TSource> list)
    where TSource : Object
    where TCast : Object;

Type parameters

TSource

TCast

The Type of the Items you want

Parameters

list Il2CppSystem.Collections.Generic.List

Returns

Il2CppSystem.Collections.Generic.List

Il2CppGenericsExt.HasItemsOfType<TSource,TCast>(this List) Method

Check if this has any items of type TCast

public static bool HasItemsOfType<TSource,TCast>(this List<TSource> list)
    where TSource : Object
    where TCast : Object;

Type parameters

TSource

TCast

The Type you're checking for

Parameters

list Il2CppSystem.Collections.Generic.List

Returns

System.Boolean

Il2CppGenericsExt.RemoveItem<TSource,TCast>(this List, TCast) Method

Return this with the first Item of type TCast removed

public static List<TSource> RemoveItem<TSource,TCast>(this List<TSource> list, TCast itemToRemove)
    where TSource : Object
    where TCast : Object;

Type parameters

TSource

TCast

The Type of the Item you want to remove

Parameters

list Il2CppSystem.Collections.Generic.List

itemToRemove TCast

The specific Item to remove

Returns

Il2CppSystem.Collections.Generic.List

Il2CppGenericsExt.RemoveItemOfType<TSource,TCast>(this List) Method

Return this with the first Item of type TCast removed

public static List<TSource> RemoveItemOfType<TSource,TCast>(this List<TSource> list)
    where TSource : Object
    where TCast : Object;

Type parameters

TSource

TCast

The Type of the Item you want to remove

Parameters

list Il2CppSystem.Collections.Generic.List

Returns

Il2CppSystem.Collections.Generic.List

Il2CppGenericsExt.RemoveItemsOfType<TSource,TCast>(this List) Method

Return this with all Items of type TCast removed

public static List<TSource> RemoveItemsOfType<TSource,TCast>(this List<TSource> list)
    where TSource : Object
    where TCast : Object;

Type parameters

TSource

TCast

The Type of the Items that you want to remove

Parameters

list Il2CppSystem.Collections.Generic.List

Returns

Il2CppSystem.Collections.Generic.List

Il2CppGenericsExt.ToArray(this List) Method

Return as an Array

public static T[] ToArray<T>(this List<T> il2CppList);

Type parameters

T

Parameters

il2CppList Il2CppSystem.Collections.Generic.List

Returns

T[]

Il2CppGenericsExt.ToIl2CppReferenceArray(this List) Method

Return as Il2CppReferenceArray

public static Il2CppReferenceArray<T> ToIl2CppReferenceArray<T>(this List<T> il2CppList)
    where T : Object;

Type parameters

T

Parameters

il2CppList Il2CppSystem.Collections.Generic.List

Returns

Il2CppInterop.Runtime.InteropTypes.Arrays.Il2CppReferenceArray

Il2CppGenericsExt.ToList(this List) Method

Return as System.List

public static System.Collections.Generic.List<T> ToList<T>(this List<T> il2CppList);

Type parameters

T

Parameters

il2CppList Il2CppSystem.Collections.Generic.List

Returns

System.Collections.Generic.List<T>

Il2CppGenericsExt.ToLockList(this List) Method

Return as LockList

public static LockList<T> ToLockList<T>(this List<T> il2CppList);

Type parameters

T

Parameters

il2CppList Il2CppSystem.Collections.Generic.List

Returns

Il2CppAssets.Scripts.Utils.LockList

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