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
curveAnimationCurveThe AnimationCurve to mofify.
amountfloatThe 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
enumerableIEnumerable<T>IEnumerable<T> to be used to get a random value.
Returns
- T
Returns a random value from IEnumerable<T>.
Type Parameters
TType 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
enumerableIEnumerable<T>IEnumerable<T> to be used to get a random value.
conditionFunc<T, bool>The condition to require.
Returns
- T
Returns a random value from IEnumerable<T>.
Type Parameters
TType of IEnumerable<T> elements.
Multiply(AnimationCurve, float)
Modify the curve with the amount used.
public static AnimationCurve Multiply(this AnimationCurve curve, float amount)
Parameters
curveAnimationCurveThe AnimationCurve to modify.
amountfloatThe multiplier number.
Returns
- AnimationCurve
The new modfied curve.