Table of Contents

Class Extensions

Namespace
TaleWorlds.Library
Assembly
TaleWorlds.Library.dll
public static class Extensions
Inheritance
Extensions
Inherited Members

Methods

AppendList<T>(List<T>, List<T>)

public static void AppendList<T>(this List<T> list1, List<T> list2)

Parameters

list1 List<T>
list2 List<T>

Type Parameters

T

FindIndex<TValue>(IReadOnlyList<TValue>, Func<TValue, bool>)

public static int FindIndex<TValue>(this IReadOnlyList<TValue> source, Func<TValue, bool> predicate)

Parameters

source IReadOnlyList<TValue>
predicate Func<TValue, bool>

Returns

int

Type Parameters

TValue

FindIndex<TValue>(MBReadOnlyList<TValue>, Func<TValue, bool>)

public static int FindIndex<TValue>(this MBReadOnlyList<TValue> source, Func<TValue, bool> predicate)

Parameters

source MBReadOnlyList<TValue>
predicate Func<TValue, bool>

Returns

int

Type Parameters

TValue

FindLastIndex<TValue>(IReadOnlyList<TValue>, Func<TValue, bool>)

public static int FindLastIndex<TValue>(this IReadOnlyList<TValue> source, Func<TValue, bool> predicate)

Parameters

source IReadOnlyList<TValue>
predicate Func<TValue, bool>

Returns

int

Type Parameters

TValue

FindLastIndex<TValue>(MBReadOnlyList<TValue>, Func<TValue, bool>)

public static int FindLastIndex<TValue>(this MBReadOnlyList<TValue> source, Func<TValue, bool> predicate)

Parameters

source MBReadOnlyList<TValue>
predicate Func<TValue, bool>

Returns

int

Type Parameters

TValue

GetCustomAttributesSafe(Assembly, bool)

public static object[] GetCustomAttributesSafe(this Assembly assembly, bool inherit)

Parameters

assembly Assembly
inherit bool

Returns

object[]

GetCustomAttributesSafe(Assembly, Type)

public static IEnumerable<Attribute> GetCustomAttributesSafe(this Assembly assembly, Type attributeType)

Parameters

assembly Assembly
attributeType Type

Returns

IEnumerable<Attribute>

GetCustomAttributesSafe(Assembly, Type, bool)

public static object[] GetCustomAttributesSafe(this Assembly assembly, Type attributeType, bool inherit)

Parameters

assembly Assembly
attributeType Type
inherit bool

Returns

object[]

GetCustomAttributesSafe(FieldInfo, bool)

public static object[] GetCustomAttributesSafe(this FieldInfo field, bool inherit)

Parameters

field FieldInfo
inherit bool

Returns

object[]

GetCustomAttributesSafe(FieldInfo, Type)

public static IEnumerable<Attribute> GetCustomAttributesSafe(this FieldInfo field, Type attributeType)

Parameters

field FieldInfo
attributeType Type

Returns

IEnumerable<Attribute>

GetCustomAttributesSafe(FieldInfo, Type, bool)

public static object[] GetCustomAttributesSafe(this FieldInfo field, Type attributeType, bool inherit)

Parameters

field FieldInfo
attributeType Type
inherit bool

Returns

object[]

GetCustomAttributesSafe(MethodInfo, bool)

public static object[] GetCustomAttributesSafe(this MethodInfo method, bool inherit)

Parameters

method MethodInfo
inherit bool

Returns

object[]

GetCustomAttributesSafe(MethodInfo, Type)

public static IEnumerable<Attribute> GetCustomAttributesSafe(this MethodInfo method, Type attributeType)

Parameters

method MethodInfo
attributeType Type

Returns

IEnumerable<Attribute>

GetCustomAttributesSafe(MethodInfo, Type, bool)

public static object[] GetCustomAttributesSafe(this MethodInfo method, Type attributeType, bool inherit)

Parameters

method MethodInfo
attributeType Type
inherit bool

Returns

object[]

GetCustomAttributesSafe(PropertyInfo, bool)

public static object[] GetCustomAttributesSafe(this PropertyInfo property, bool inherit)

Parameters

property PropertyInfo
inherit bool

Returns

object[]

GetCustomAttributesSafe(PropertyInfo, Type)

public static IEnumerable<Attribute> GetCustomAttributesSafe(this PropertyInfo property, Type attributeType)

Parameters

property PropertyInfo
attributeType Type

Returns

IEnumerable<Attribute>

GetCustomAttributesSafe(PropertyInfo, Type, bool)

public static object[] GetCustomAttributesSafe(this PropertyInfo property, Type attributeType, bool inherit)

Parameters

property PropertyInfo
attributeType Type
inherit bool

Returns

object[]

GetCustomAttributesSafe(Type, bool)

public static object[] GetCustomAttributesSafe(this Type type, bool inherit)

Parameters

type Type
inherit bool

Returns

object[]

GetCustomAttributesSafe(Type, Type)

public static IEnumerable<Attribute> GetCustomAttributesSafe(this Type type, Type attributeType)

Parameters

type Type
attributeType Type

Returns

IEnumerable<Attribute>

GetCustomAttributesSafe(Type, Type, bool)

public static object[] GetCustomAttributesSafe(this Type type, Type attributeType, bool inherit)

Parameters

type Type
attributeType Type
inherit bool

Returns

object[]

GetDeterministicHashCode(string)

public static int GetDeterministicHashCode(this string text)

Parameters

text string

Returns

int

GetReadOnlyDictionary<TKey, TValue>(Dictionary<TKey, TValue>)

public static MBReadOnlyDictionary<TKey, TValue> GetReadOnlyDictionary<TKey, TValue>(this Dictionary<TKey, TValue> dictionary)

Parameters

dictionary Dictionary<TKey, TValue>

Returns

MBReadOnlyDictionary<TKey, TValue>

Type Parameters

TKey
TValue

GetTypesSafe(Assembly, Func<Type, bool>)

public static List<Type> GetTypesSafe(this Assembly assembly, Func<Type, bool> func = null)

Parameters

assembly Assembly
func Func<Type, bool>

Returns

List<Type>

HasAllFlags<T>(T, T)

public static bool HasAllFlags<T>(this T p1, T p2) where T : struct

Parameters

p1 T
p2 T

Returns

bool

Type Parameters

T

HasAnyFlag<T>(T, T)

public static bool HasAnyFlag<T>(this T p1, T p2) where T : struct

Parameters

p1 T
p2 T

Returns

bool

Type Parameters

T

IndexOfMax<TSource>(IReadOnlyList<TSource>, Func<TSource, int>)

public static int IndexOfMax<TSource>(this IReadOnlyList<TSource> self, Func<TSource, int> func)

Parameters

self IReadOnlyList<TSource>
func Func<TSource, int>

Returns

int

Type Parameters

TSource

IndexOfMax<TSource>(MBReadOnlyList<TSource>, Func<TSource, int>)

public static int IndexOfMax<TSource>(this MBReadOnlyList<TSource> self, Func<TSource, int> func)

Parameters

self MBReadOnlyList<TSource>
func Func<TSource, int>

Returns

int

Type Parameters

TSource

IndexOfMin<TSource>(IReadOnlyList<TSource>, Func<TSource, int>)

public static int IndexOfMin<TSource>(this IReadOnlyList<TSource> self, Func<TSource, int> func)

Parameters

self IReadOnlyList<TSource>
func Func<TSource, int>

Returns

int

Type Parameters

TSource

IndexOfMin<TSource>(MBReadOnlyList<TSource>, Func<TSource, int>)

public static int IndexOfMin<TSource>(this MBReadOnlyList<TSource> self, Func<TSource, int> func)

Parameters

self MBReadOnlyList<TSource>
func Func<TSource, int>

Returns

int

Type Parameters

TSource

IndexOf<TValue>(TValue[], TValue)

public static int IndexOf<TValue>(this TValue[] source, TValue item)

Parameters

source TValue[]
item TValue

Returns

int

Type Parameters

TValue

Randomize<T>(IList<T>)

public static void Randomize<T>(this IList<T> array)

Parameters

array IList<T>

Type Parameters

T

ToMBList<T>(IEnumerable<T>)

public static MBList<T> ToMBList<T>(this IEnumerable<T> source)

Parameters

source IEnumerable<T>

Returns

MBList<T>

Type Parameters

T

ToMBList<T>(List<T>)

public static MBList<T> ToMBList<T>(this List<T> source)

Parameters

source List<T>

Returns

MBList<T>

Type Parameters

T

ToMBList<T>(T[])

public static MBList<T> ToMBList<T>(this T[] source)

Parameters

source T[]

Returns

MBList<T>

Type Parameters

T

This page was last modified at 09/01/2024 16:12:00 +00:00 (UTC).