Class Extensions
Miscellaneous extensions, primarily on System types.
Inheritance
System.Object
Extensions
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Assembly: ItemChanger.dll
Syntax
public static class Extensions
Methods
|
Improve this Doc
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
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
CapLength(String, Int32)
Declaration
public static string CapLength(this string s, int length)
Parameters
Type |
Name |
Description |
System.String |
s |
|
System.Int32 |
length |
|
Returns
Type |
Description |
System.String |
|
|
Improve this Doc
View Source
Compare(Int32, ComparisonOperator, Int32)
Declaration
public static bool Compare(this int a, ComparisonOperator op, int b)
Parameters
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
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 |
Description |
System.Boolean |
|
Type Parameters
|
Improve this Doc
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 = null)
Parameters
Type |
Name |
Description |
Dictionary<TKey, TValue> |
dict |
|
TKey |
key |
|
TValue |
add |
|
Returns
Type Parameters
Name |
Description |
TKey |
|
TValue |
|
|
Improve this Doc
View Source
GetOrAddComponent<T>(GameObject)
Declaration
public static T GetOrAddComponent<T>(this GameObject go)
where T : Component
Parameters
Type |
Name |
Description |
GameObject |
go |
|
Returns
Type Parameters
|
Improve this Doc
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 = null)
Parameters
Type |
Name |
Description |
Dictionary<TKey, TValue> |
dict |
|
TKey |
key |
|
TValue |
default |
|
Returns
Type Parameters
Name |
Description |
TKey |
|
TValue |
|
|
Improve this Doc
View Source
IndexOf<T>(IEnumerable<T>, T)
Declaration
public static int IndexOf<T>(this IEnumerable<T> ts, T t)
Parameters
Type |
Name |
Description |
IEnumerable<T> |
ts |
|
T |
t |
|
Returns
Type |
Description |
System.Int32 |
|
Type Parameters
|
Improve this Doc
View Source
Yield<T>(T)
Declaration
public static IEnumerable<T> Yield<T>(this T t)
Parameters
Type |
Name |
Description |
T |
t |
|
Returns
Type |
Description |
IEnumerable<T> |
|
Type Parameters