#ifndef MDD_MODULEMATH_H
#define MDD_MODULEMATH_H
#include "ModuleBase.h"

namespace mdd {
    enum class MathOperation : char {
        ADD = 1,
        SUBTRACT = 2,
        MULTIPLY = 3,
        DIVIDE = 4,
        POWER = 5,
        LOGARITHM = 6,
        MINIMUM = 7,
        MAXIMUM = 8,
        LESS_THAN = 9,
        GREATER_THAN = 10
    };

    class ModuleMath : public ModuleBase {
    private:
        MathOperation _operation;

        static std::vector<double> add(const std::vector<double>&val1, const std::vector<double>&val2);
        static std::vector<double> subtract(const std::vector<double>&val1, const std::vector<double>&val2);
        static std::vector<double> multiply(const std::vector<double>&val1, const std::vector<double>&val2);
        static std::vector<double> divide(const std::vector<double>&val1, const std::vector<double>&val2);
        static std::vector<double> power(const std::vector<double>&val1, const std::vector<double>&val2);
        static std::vector<double> logarithm(const std::vector<double>&val1, const std::vector<double>&val2);
        static std::vector<double> minimum(const std::vector<double>&val1, const std::vector<double>&val2);
        static std::vector<double> maximum(const std::vector<double>&val1, const std::vector<double>&val2);
        static std::vector<double> less(const std::vector<double>&val1, const std::vector<double>&val2);
        static std::vector<double> greater(const std::vector<double>&val1, const std::vector<double>&val2);

    public:
        explicit ModuleMath(MathOperation operation = MathOperation::ADD);
        state update() override;
        void setMathOperation(MathOperation operation);
        MathOperation getMathOperation();
    };
}
#endif
