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