Class CommonExtensions
- Namespace
- Exiled.API.Extensions
- Assembly
- Exiled.API.dll
A set of extensions for common things.
public static class CommonExtensions
- Inheritance
-
CommonExtensions
- Inherited Members
Methods
Add(AnimationCurve, float)
Modify the curve with the amount used.
public static AnimationCurve Add(this AnimationCurve curve, float amount)
Parameters
curve
AnimationCurveThe AnimationCurve to mofify.
amount
floatThe add number.
Returns
- AnimationCurve
The new modfied curve.
GetRandomValue<T>(IEnumerable<T>)
Gets a random value from an IEnumerable<T>.
public static T GetRandomValue<T>(this IEnumerable<T> enumerable)
Parameters
enumerable
IEnumerable<T>IEnumerable<T> to be used to get a random value.
Returns
- T
Returns a random value from IEnumerable<T>.
Type Parameters
T
Type of IEnumerable<T> elements.
GetRandomValue<T>(IEnumerable<T>, Func<T, bool>)
Gets a random value from an IEnumerable<T> that matches the provided condition.
public static T GetRandomValue<T>(this IEnumerable<T> enumerable, Func<T, bool> condition)
Parameters
enumerable
IEnumerable<T>IEnumerable<T> to be used to get a random value.
condition
Func<T, bool>The condition to require.
Returns
- T
Returns a random value from IEnumerable<T>.
Type Parameters
T
Type of IEnumerable<T> elements.
Multiply(AnimationCurve, float)
Modify the curve with the amount used.
public static AnimationCurve Multiply(this AnimationCurve curve, float amount)
Parameters
curve
AnimationCurveThe AnimationCurve to modify.
amount
floatThe multiplier number.
Returns
- AnimationCurve
The new modfied curve.