(C++)  1.0.0
A multi-platform, modular, universal engine for embedding advanced AI in games.
PowerFunction.hh
1 #ifndef GRAIL_POWER_FUNCTION_H
2 #define GRAIL_POWER_FUNCTION_H
3 
4 #include "Curve.hh"
5 
6 
7 namespace grail
8 {
9  namespace curves
10  {
11  class PowerFunction final : public Curve
12  {
13  public:
14  PowerFunction(float initSlope, float initIntercept, float initExponent);
15  PowerFunction(std::pair<float, float> firstPoint, std::pair<float, float> secondPoint, float initExponent);
16 
17  virtual float Sample(float argument) const override;
18 
19  float GetSlope() const;
20  float GetIntercept() const;
21  float GetExponent() const;
22 
23  CurveTypeId GetTypeId() const override;
24 
25  private:
26  float slope = 0.0f;
27  float intercept = 0.0f;
28  float exponent = 0.0f;
29  };
30  }
31 }
32 
33 #endif // GRAIL_POWER_FUNCTION_H
The Curve class - Defines objects transforming one value into the other.
Definition: Curve.hh:17
Definition: PowerFunction.hh:12
virtual float Sample(float argument) const override
Sample - User-defined method which processes provided value (currently vector of values - multidemens...
Definition: PowerFunction.cpp:33