/***************************************************************************
*                                                                          *
*  Copyright (C) Golaem S.A.  All Rights Reserved.                         *
*                                                                          *
***************************************************************************/

#pragma once

#include "glmMap.h"
#include "glmMathBase.h"

namespace glm
{
	/**
	* Ramp
	*/
	class GLM_CORE_API Ramp
	{
    public:
        Ramp();
        Ramp(float value);
		Ramp(float value0, float position0, float value1, float position1);
		virtual ~Ramp();

        unsigned int getNbValues() const;
        void setValueAtPosition(float value, float position);
        float getValueAtPosition(float position) const;
		void setEntries(const glm::GlmMap<float, float>& entries);
		const glm::GlmMap<float, float>& getEntries() const;
        void clear();
        float cast(float value) const;

    protected:
        glm::GlmMap<float, float> _entries;

    public:
        // range
        float _inputMin = 0.f;
        float _inputMax = 1.f;
        float _outputMin = 0.f;
        float _outputMax = 1.f;
        int _outputType = 0; // 0 for float, 1 for int floor, 2 for int ceil
    };

	/**
	* DynamicRamp
	*/
    class GLM_CORE_API DynamicRamp : public Ramp
    {
    public:
        DynamicRamp();
        ~DynamicRamp();

        bool _isRandom = true;  // Noise seed is different per entity
        bool _isDynamic = true; // Value changes across time
        int _evalMode = 0;      // 0 for noise, 1 for loop, 2 for oscillate, 3 for once
        float _duration = 1.f;  // Duration (in seconds)
    };
}
