Class Extensions
Miscellaneous extensions, primarily on System types.
Assembly: ItemChanger.dll
Syntax
public static class Extensions
Methods
View Source
AnyEverObtained(IEnumerable<AbstractItem>)
Returns true when the collection has a previously given item, or is null or empty.
Declaration
public static bool AnyEverObtained(this IEnumerable<AbstractItem> items)
Parameters
Returns
View Source
CapLength(string, int)
Declaration
public static string CapLength(this string s, int length)
Parameters
Returns
View Source
Compare(int, ComparisonOperator, int)
Declaration
public static bool Compare(this int a, ComparisonOperator op, int b)
Parameters
Returns
View Source
Compare<T>(T, ComparisonOperator, T)
Declaration
public static bool Compare<T>(this T t, ComparisonOperator op, T u) where T : IComparable
Parameters
Returns
Type Parameters
View Source
GetOrAddComponent<T>(GameObject)
Declaration
public static T GetOrAddComponent<T>(this GameObject go) where T : Component
Parameters
Returns
Type Parameters
View Source
GetOrAdd<TKey, TValue>(Dictionary<TKey, TValue?>, TKey, TValue?)
Declaration
public static TValue? GetOrAdd<TKey, TValue>(this Dictionary<TKey, TValue?> dict, TKey key, TValue? add = default)
Parameters
| Type |
Name |
Description |
| Dictionary<TKey, TValue> |
dict |
|
| TKey |
key |
|
| TValue |
add |
|
Returns
Type Parameters
| Name |
Description |
| TKey |
|
| TValue |
|
View Source
GetOrDefault<TKey, TValue>(Dictionary<TKey, TValue?>, TKey, TValue?)
Declaration
public static TValue? GetOrDefault<TKey, TValue>(this Dictionary<TKey, TValue?> dict, TKey key, TValue? @default = default)
Parameters
| Type |
Name |
Description |
| Dictionary<TKey, TValue> |
dict |
|
| TKey |
key |
|
| TValue |
default |
|
Returns
Type Parameters
| Name |
Description |
| TKey |
|
| TValue |
|
View Source
IndexOf<T>(IEnumerable<T>, T)
Declaration
public static int IndexOf<T>(this IEnumerable<T> ts, T t)
Parameters
Returns
Type Parameters
View Source
Yield<T>(T)
Declaration
public static IEnumerable<T> Yield<T>(this T t)
Parameters
| Type |
Name |
Description |
| T |
t |
|
Returns
Type Parameters