#pragma once

#include <functional>
#include <string>

#include "adapters/il2cpp/Il2CppObjectInstance.h"
#include "features/quests/contracts/QuestTypes.h"

namespace ta::adapters::eft::quests
{
    struct QuestRuntimeQuest
    {
        ta::adapters::il2cpp::Il2CppObjectInstance& quest_controller;
        ta::adapters::il2cpp::Il2CppObjectInstance& quest;
        ta::adapters::il2cpp::Il2CppObjectInstance& quest_template;
        std::string id;
        int status = 0;
    };

    class QuestRuntimeReader
    {
    public:
        using Visitor = std::function<void(QuestRuntimeQuest&)>;

        static bool visit_quests(ta::adapters::il2cpp::Il2CppObjectInstance main_player, const Visitor& visitor);
        static ta::features::quests::contracts::QuestEntry make_quest_entry(QuestRuntimeQuest& runtime_quest);

    private:
        static std::string trader_display_name(const std::string& id);
    };
}
