Skip to Main Content

BTD_Mod_Helper​.Extensions​.ListExt


BloonsTD6 Mod Helper

BTD_Mod_Helper.Extensions

ListExt Class

Extensions for non il2cpp Lists

public static class ListExt

Inheritance System.Object  ListExt

Methods

ListExt.Duplicate(this List) Method

Return a duplicate of this

public static System.Collections.Generic.List<T> Duplicate<T>(this System.Collections.Generic.List<T> list);

Type parameters

T

Parameters

list System.Collections.Generic.List<T>

Returns

System.Collections.Generic.List<T>

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

Return a duplicate of this as type TCast

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

Type parameters

TSource

TCast

Parameters

list System.Collections.Generic.List<TSource>

Returns

System.Collections.Generic.List<TCast>

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

Return the first item of type TCast

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

Type parameters

TSource

TCast

The Type of the Item you want

Parameters

list System.Collections.Generic.List<TSource>

Returns

TCast

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

Return all Items of type TCast

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

Type parameters

TSource

TCast

The Type of the Items you want

Parameters

list System.Collections.Generic.List<TSource>

Returns

System.Collections.Generic.List<TCast>

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

Check if this has any items of type TCast

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

Type parameters

TSource

TCast

The Type you're checking for

Parameters

list System.Collections.Generic.List<TSource>

Returns

System.Boolean

ListExt.LoadFromFile(this List, string, bool) Method

Load a List from a FilePath

public static T LoadFromFile<T>(this System.Collections.Generic.List<T> list, string filePath, out bool success);

Type parameters

T

Parameters

list System.Collections.Generic.List<T>

filePath System.String

FilePath of the saved List

success System.Boolean

Will be true if the List was successfully loaded, otherwise will be false

Returns

T
The loaded List if successful, otherwise default value

ListExt.LoadFromFile(this List, string) Method

Load a List from a FilePath

public static T LoadFromFile<T>(this System.Collections.Generic.List<T> list, string filePath);

Type parameters

T

Parameters

list System.Collections.Generic.List<T>

filePath System.String

FilePath of the saved List

Returns

T
The loaded List if successful, otherwise default value

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

Return this with the first Item of type TCast removed

public static System.Collections.Generic.List<TSource> RemoveItem<TSource,TCast>(this System.Collections.Generic.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 System.Collections.Generic.List<TSource>

itemToRemove TCast

The specific Item to remove

Returns

System.Collections.Generic.List<TSource>

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

Return this with the first Item of type TCast removed

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

Type parameters

TSource

TCast

The Type of the Item you want to remove

Parameters

list System.Collections.Generic.List<TSource>

Returns

System.Collections.Generic.List<TSource>

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

Return this with all Items of type TCast removed

public static System.Collections.Generic.List<TSource> RemoveItemsOfType<TSource,TCast>(this System.Collections.Generic.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 System.Collections.Generic.List<TSource>

Returns

System.Collections.Generic.List<TSource>

ListExt.SaveToFile(this List, string) Method

Save a list to file

public static bool SaveToFile<T>(this System.Collections.Generic.List<T> list, string filePath);

Type parameters

T

Parameters

list System.Collections.Generic.List<T>

The list you want to save

filePath System.String

The FilePath you want to save it to

Returns

System.Boolean
True if successful, false if it fails

ListExt.ToIl2CppList(this List) Method

Return as Il2CppSystem.List

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

Type parameters

T

Parameters

list System.Collections.Generic.List<T>

Returns

Il2CppSystem.Collections.Generic.List

ListExt.ToIl2CppReferenceArray(this List) Method

Return as Il2CppReferenceArray

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

Type parameters

T

Parameters

list System.Collections.Generic.List<T>

Returns

Il2CppInterop.Runtime.InteropTypes.Arrays.Il2CppReferenceArray

ListExt.ToLockList(this List) Method

Return as LockList

public static LockList<T> ToLockList<T>(this System.Collections.Generic.List<T> list);

Type parameters

T

Parameters

list System.Collections.Generic.List<T>

Returns

Il2CppAssets.Scripts.Utils.LockList

ListExt.ToRootObjectLockList(this List) Method

Return as LockList

public static RootObjectLockList<T> ToRootObjectLockList<T>(this System.Collections.Generic.List<T> list)
    where T : Il2CppObjectBase;

Type parameters

T

Parameters

list System.Collections.Generic.List<T>

Returns

Il2CppAssets.Scripts.Simulation.Objects.RootObjectLockList

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