Class ResponseCurveBase<T>
- Namespace
- Gamelogic.Extensions.Algorithms
- Assembly
- Gamelogic.Extensions.dll
A class that can be used as the base of the implementation of a response curve.
[Version(1, 2, 0)]
public abstract class ResponseCurveBase<T> : IResponseCurve<T>
Type Parameters
T
- Inheritance
-
ResponseCurveBase<T>
- Implements
- Derived
- Inherited Members
- Extension Methods
Remarks
This is a more convenient way to implement the IResponseCurve<T> interface, since all you need to do is specify how the type is interpolated by implementing the Lerp(T, T, float) method.
There are cases where it makes sense to implement IResponseCurve<T> for a discrete type T, but in those cases this class is not a suitable base, as it is obscure to describe the mapping using interpolation.
Constructors
- ResponseCurveBase(IEnumerable<float>, IEnumerable<T>)
Initializes a new instance of the ResponseCurveBase<T> class.
Properties
- this[float]
Evaluates the curve at the given input and returns the result.
Methods
- Evaluate(float)
Evaluates the curve at the specified value.
- Lerp(T, T, float)
Linearly interpolates between the two given samples.