Skip to Main Content
Table of Contents

BTD_Mod_Helper​.Extensions​.ArrayExt


BloonsTD6 Mod Helper

BTD_Mod_Helper.Extensions

ArrayExt Class

Extensions for arrays

public static class ArrayExt

Inheritance System.Object  ArrayExt

Methods

ArrayExt.AddTo(this T[], List) Method

Return this with Items added to it

public static T[] AddTo<T>(this T[] array, System.Collections.Generic.List<T> objectsToAdd)
    where T : Object;

Type parameters

T

The Type of the Items you want to add

Parameters

array T[]

objectsToAdd System.Collections.Generic.List<T>

Items you want to add

Returns

T[]

ArrayExt.AddTo(this T[], T) Method

Return this with an Item added to it

public static T[] AddTo<T>(this T[] array, T objectToAdd)
    where T : Object;

Type parameters

T

The Type of the Item you want to add

Parameters

array T[]

objectToAdd T

Item to add to this

Returns

T[]

ArrayExt.AddTo(this T[], T[]) Method

Return this with Items added to it

public static T[] AddTo<T>(this T[] array, T[] objectsToAdd)
    where T : Object;

Type parameters

T

The Type of the Items you want to add

Parameters

array T[]

objectsToAdd T[]

Items you want to add

Returns

T[]

ArrayExt.Any(this T[], Func<T,bool>) Method

Return whether or not there are any elements in this that match the predicate

public static bool Any<T>(this T[] array, System.Func<T,bool> predicate);

Type parameters

T

Parameters

array T[]

predicate System.Func<T,System.Boolean>

Returns

System.Boolean

ArrayExt.Any(this T[]) Method

Return whether or not there are any elements in this

public static bool Any<T>(this T[] array);

Type parameters

T

Parameters

array T[]

Returns

System.Boolean

ArrayExt.CheckTypes<T1,T2,T3,T4,T5,T6>(this object[], T1, T2, T3, T4, T5, T6) Method

Checks if the parameter array has the given types

public static bool CheckTypes<T1,T2,T3,T4,T5,T6>(this object[] parameters, out T1 param1, out T2 param2, out T3 param3, out T4 param4, out T5 param5, out T6 param6);

Type parameters

T1

T2

T3

T4

T5

T6

Parameters

parameters System.Object[]

param1 T1

param2 T2

param3 T3

param4 T4

param5 T5

param6 T6

Returns

System.Boolean

ArrayExt.CheckTypes<T1,T2,T3,T4,T5>(this object[], T1, T2, T3, T4, T5) Method

Checks if the parameter array has the given types

public static bool CheckTypes<T1,T2,T3,T4,T5>(this object[] parameters, out T1 param1, out T2 param2, out T3 param3, out T4 param4, out T5 param5);

Type parameters

T1

T2

T3

T4

T5

Parameters

parameters System.Object[]

param1 T1

param2 T2

param3 T3

param4 T4

param5 T5

Returns

System.Boolean

ArrayExt.CheckTypes<T1,T2,T3,T4>(this object[], T1, T2, T3, T4) Method

Checks if the parameter array has the given types

public static bool CheckTypes<T1,T2,T3,T4>(this object[] parameters, out T1 param1, out T2 param2, out T3 param3, out T4 param4);

Type parameters

T1

T2

T3

T4

Parameters

parameters System.Object[]

param1 T1

param2 T2

param3 T3

param4 T4

Returns

System.Boolean

ArrayExt.CheckTypes<T1,T2,T3>(this object[], T1, T2, T3) Method

Checks if the parameter array has the given types

public static bool CheckTypes<T1,T2,T3>(this object[] parameters, out T1 param1, out T2 param2, out T3 param3);

Type parameters

T1

T2

T3

Parameters

parameters System.Object[]

param1 T1

param2 T2

param3 T3

Returns

System.Boolean

ArrayExt.CheckTypes<T1,T2>(this object[], T1, T2) Method

Checks if the parameter array has the given types

public static bool CheckTypes<T1,T2>(this object[] parameters, out T1 param1, out T2 param2);

Type parameters

T1

T2

Parameters

parameters System.Object[]

param1 T1

param2 T2

Returns

System.Boolean

ArrayExt.CheckTypes(this object[], T1) Method

Checks if the parameter array has the given types

public static bool CheckTypes<T1>(this object[] parameters, out T1 param1);

Type parameters

T1

Parameters

parameters System.Object[]

param1 T1

Returns

System.Boolean

ArrayExt.Duplicate(this T[]) Method

Return a duplicate of this Array

public static T[] Duplicate<T>(this T[] array);

Type parameters

T

Parameters

array T[]

Returns

T[]

ArrayExt.DuplicateAs<TSource,TCast>(this TSource[]) Method

Return a duplicate of this array as type TCast

public static TCast[] DuplicateAs<TSource,TCast>(this TSource[] array)
    where TSource : Object
    where TCast : Object;

Type parameters

TSource

The original Array Type

TCast

The Cast type

Parameters

array TSource[]

Returns

TCast[]

ArrayExt.FindAll(this T[], Predicate) Method

Retrieves all the elements that match the conditions defined by the specified predicate.

public static T[] FindAll<T>(this T[] array, System.Predicate<T> match);

Type parameters

T

Parameters

array T[]

match System.Predicate<T>

The Predicate delegate that defines the conditions of the elements to search for.

Returns

T[]

ArrayExt.ForEach(this T[], Action) Method

Performs the specified action on each element

public static void ForEach<T>(this T[] array, System.Action<T> action);

Type parameters

T

Parameters

array T[]

action System.Action<T>

Action to preform on each element

ArrayExt.GetItemOfType<TSource,TCast>(this TSource[]) Method

Return the first Item of type TCast

public static TCast GetItemOfType<TSource,TCast>(this TSource[] array)
    where TSource : Object
    where TCast : Object;

Type parameters

TSource

TCast

The Type of the Item you want

Parameters

array TSource[]

Returns

TCast

ArrayExt.GetItemsOfType<TSource,TCast>(this TSource[]) Method

Return all Items of type TCast

public static System.Collections.Generic.IEnumerable<TCast> GetItemsOfType<TSource,TCast>(this TSource[] array)
    where TSource : Object
    where TCast : Object;

Type parameters

TSource

TCast

The Type of the Items you want

Parameters

array TSource[]

Returns

System.Collections.Generic.IEnumerable<TCast>

ArrayExt.HasItemsOfType<TSource,TCast>(this TSource[]) Method

Check if this has any items of type TCast

public static bool HasItemsOfType<TSource,TCast>(this TSource[] array)
    where TSource : Object
    where TCast : Object;

Type parameters

TSource

TCast

The Type you're checking for

Parameters

array TSource[]

Returns

System.Boolean

ArrayExt.IsValid(this int[]) Method

Returns whether an int array is a valid set of tiers for a Tower

public static bool IsValid(this int[] tiers);

Parameters

tiers System.Int32[]

Returns

System.Boolean

ArrayExt.Order(this int[]) Method

Returns the index of the highest tier, then the middle, then the lowest


Breaks ties by Middle Path >> Top Path >> Bottom Path

public static int[] Order(this int[] arr);

Parameters

arr System.Int32[]

Returns

System.Int32[]

ArrayExt.Printed(this int[]) Method

A string with all array elements printed together with no spaces


Useful for the suffix for Tower IDS like DartMonkey-230

public static string Printed(this int[] arr);

Parameters

arr System.Int32[]

The array

Returns

System.String

ArrayExt.RemoveItem<TSource,TCast>(this TSource[], TCast) Method

Return this with the first Item of type TCast removed

public static TSource[] RemoveItem<TSource,TCast>(this TSource[] array, TCast itemToRemove)
    where TSource : Object
    where TCast : Object;

Type parameters

TSource

TCast

The Type of the Item you want to remove

Parameters

array TSource[]

itemToRemove TCast

The specific Item to remove

Returns

TSource[]

ArrayExt.RemoveItemOfType<TSource,TCast>(this TSource[]) Method

Return this with the first Item of type TCast removed

public static TSource[] RemoveItemOfType<TSource,TCast>(this TSource[] array)
    where TSource : Object
    where TCast : Object;

Type parameters

TSource

TCast

The Type of the Item you want to remove

Parameters

array TSource[]

Returns

TSource[]

ArrayExt.RemoveItemsOfType<TSource,TCast>(this TSource[]) Method

Return this with all Items of type TCast removed

public static TSource[] RemoveItemsOfType<TSource,TCast>(this TSource[] array)
    where TSource : Object
    where TCast : Object;

Type parameters

TSource

TCast

The Type of the Items that you want to remove

Parameters

array TSource[]

Returns

TSource[]

ArrayExt.ToIl2CppList(this T[]) Method

Return as Il2CppSystem.List

public static List<T> ToIl2CppList<T>(this T[] array)
    where T : Object;

Type parameters

T

Parameters

array T[]

Returns

Il2CppSystem.Collections.Generic.List

ArrayExt.ToIl2CppReferenceArray(this T[]) Method

Return as Il2CppReferenceArray

public static Il2CppReferenceArray<T> ToIl2CppReferenceArray<T>(this T[] array)
    where T : Object;

Type parameters

T

Parameters

array T[]

Returns

Il2CppInterop.Runtime.InteropTypes.Arrays.Il2CppReferenceArray

ArrayExt.ToLockList(this T[]) Method

Return as LockList

public static LockList<T> ToLockList<T>(this T[] array);

Type parameters

T

Parameters

array T[]

Returns

Il2CppAssets.Scripts.Utils.LockList

ArrayExt.TryCast(Il2CppObjectBase, T) Method

Version of TryCast without the generic restriction

private static bool TryCast<T>(Il2CppObjectBase obj, out T t);

Type parameters

T

Parameters

obj Il2CppInterop.Runtime.InteropTypes.Il2CppObjectBase

t T

Returns

System.Boolean

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