 | ResponseCurveSelectTSource, TResult Method |
Creates a response curve that transforms the output of the given curve
using the given function.
Namespace:
Gamelogic.Extensions.Algorithms
Assembly:
Assembly-CSharp (in Assembly-CSharp.dll) Version: 0.0.0.0
Syntaxpublic static IResponseCurve<TResult> Select<TSource, TResult>(
this IResponseCurve<TSource> source,
Func<TSource, TResult> selector
)
Parameters
- source
- Type: Gamelogic.Extensions.AlgorithmsIResponseCurveTSource
The source curve. - selector
- Type: SystemFuncTSource, TResult
The selector used to transform results from the source curve.
Type Parameters
- TSource
- The type of the source response curve.
- TResult
- The type of the result response curve.
Return Value
Type:
IResponseCurveTResultIResponseCurve<TResult>.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type
IResponseCurveTSource. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).
ExamplesThe following makes a response curve that returns string representation of the
results of a float response curve:
var curve = new ResponseCurveFloat(new[] {0f, 0.5f, 1f}, new []{0f, 1f, 10f}).Select(x => x.TosString());
uiComponent.text = (curve[0.75f]);
See Also