Table of Contents
Extensions for non il2cpp Lists
public static class ListExt
Inheritance System.Object ListExt
Return a duplicate of this
public static System.Collections.Generic.List<T> Duplicate<T>(this System.Collections.Generic.List<T> list);
T
list
System.Collections.Generic.List<T>
System.Collections.Generic.List<T>
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;
TSource
TCast
list
System.Collections.Generic.List<TSource>
System.Collections.Generic.List<TCast>
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;
TSource
TCast
The Type of the Item you want
list
System.Collections.Generic.List<TSource>
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;
TSource
TCast
The Type of the Items you want
list
System.Collections.Generic.List<TSource>
System.Collections.Generic.List<TCast>
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;
TSource
TCast
The Type you're checking for
list
System.Collections.Generic.List<TSource>
Load a List from a FilePath
public static T LoadFromFile<T>(this System.Collections.Generic.List<T> list, string filePath, out bool success);
T
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
T
The loaded List if successful, otherwise default value
Load a List from a FilePath
public static T LoadFromFile<T>(this System.Collections.Generic.List<T> list, string filePath);
T
list
System.Collections.Generic.List<T>
filePath
System.String
FilePath of the saved List
T
The loaded List if successful, otherwise default value
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;
TSource
TCast
The Type of the Item you want to remove
list
System.Collections.Generic.List<TSource>
itemToRemove
TCast
The specific Item to remove
System.Collections.Generic.List<TSource>
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;
TSource
TCast
The Type of the Item you want to remove
list
System.Collections.Generic.List<TSource>
System.Collections.Generic.List<TSource>
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;
TSource
TCast
The Type of the Items that you want to remove
list
System.Collections.Generic.List<TSource>
System.Collections.Generic.List<TSource>
Save a list to file
public static bool SaveToFile<T>(this System.Collections.Generic.List<T> list, string filePath);
T
list
System.Collections.Generic.List<T>
The list you want to save
filePath
System.String
The FilePath you want to save it to
System.Boolean
True if successful, false if it fails
Return as Il2CppSystem.List
public static List<T> ToIl2CppList<T>(this System.Collections.Generic.List<T> list);
T
list
System.Collections.Generic.List<T>
Il2CppSystem.Collections.Generic.List
Return as Il2CppReferenceArray
public static Il2CppReferenceArray<T> ToIl2CppReferenceArray<T>(this System.Collections.Generic.List<T> list)
where T : Object;
T
list
System.Collections.Generic.List<T>
Il2CppInterop.Runtime.InteropTypes.Arrays.Il2CppReferenceArray
Return as LockList
public static LockList<T> ToLockList<T>(this System.Collections.Generic.List<T> list);
T
list
System.Collections.Generic.List<T>
Il2CppAssets.Scripts.Utils.LockList
Return as LockList
public static RootObjectLockList<T> ToRootObjectLockList<T>(this System.Collections.Generic.List<T> list)
where T : Il2CppObjectBase;
T
list
System.Collections.Generic.List<T>