#ifndef PORYGONLANG_USERDATAFUNCTIONTYPE_HPP
#define PORYGONLANG_USERDATAFUNCTIONTYPE_HPP

#include <utility>
#include "../ScriptTypes/ScriptType.hpp"
#include "../ScriptTypes/FunctionScriptType.hpp"

namespace Porygon::UserData{
    class UserDataFunctionOption : public GenericFunctionOption{
    public:
        UserDataFunctionOption(std::shared_ptr<ScriptType> returnType, vector<shared_ptr<ScriptType>> parameterTypes)
        : GenericFunctionOption(std::move(returnType), std::move(parameterTypes)) {

        }
        static UserDataFunctionOption* FromRawPointers(ScriptType* returnType, vector<ScriptType*> parameterTypes){
            auto rt = shared_ptr<ScriptType>(returnType);
            auto p = vector<shared_ptr<ScriptType>>(parameterTypes.size());
            for (size_t i = 0; i < parameterTypes.size(); i++){
                p[i] = shared_ptr<ScriptType>(parameterTypes[i]);
            }
            return new UserDataFunctionOption(rt, p);
        }

        inline static UserDataFunctionOption* FromRawPointers(ScriptType* returnType){
            auto rt = shared_ptr<ScriptType>(returnType);
            return new UserDataFunctionOption(rt, {});
        }

        [[nodiscard]] inline bool IsScriptFunction() const final{
            return false;
        }
    };
}


#endif //PORYGONLANG_USERDATAFUNCTIONTYPE_HPP
