#ifndef PERLIN_1D_HPP_
#define PERLIN_1D_HPP_

#include <GeneratorNode/GeneratorNode.hpp>

class Perlin1D final
{
private:
    GeneratorNode genNode;

    float fade(float t);
    float lerp(float a, float b, float t);
    float getControlPoint(uint64_t t);

public:
    Perlin1D(GeneratorNode node);

    /**
     * @brief Returns the sample at a given time.
     * 
     * @param t The time, given as the index of the closest control point.
     * @param offset The offset between `t` and `t+1` (0-1).
     */
    float sample(uint64_t t, float offset);
};

#endif