Show / Hide Table of Contents

Class Extensions

Miscellaneous extensions, primarily on System types.

Inheritance
object
Extensions
Inherited Members
object.GetType()
object.MemberwiseClone()
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
Namespace: ItemChanger.Extensions
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
Type Name Description
IEnumerable<AbstractItem> items
Returns
Type Description
bool
View Source

CapLength(string, int)

Declaration
public static string CapLength(this string s, int length)
Parameters
Type Name Description
string s
int length
Returns
Type Description
string
View Source

Compare(int, ComparisonOperator, int)

Declaration
public static bool Compare(this int a, ComparisonOperator op, int b)
Parameters
Type Name Description
int a
ComparisonOperator op
int b
Returns
Type Description
bool
View Source

Compare<T>(T, ComparisonOperator, T)

Declaration
public static bool Compare<T>(this T t, ComparisonOperator op, T u) where T : IComparable
Parameters
Type Name Description
T t
ComparisonOperator op
T u
Returns
Type Description
bool
Type Parameters
Name Description
T
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 Description
T
Type Parameters
Name Description
T
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 Description
TValue
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 Description
TValue
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
Type Name Description
IEnumerable<T> ts
T t
Returns
Type Description
int
Type Parameters
Name Description
T
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
Name Description
T
  • View Source
In this article
Back to top Generated by DocFX