#pragma once

#include <string>
#include <unordered_map>

struct Il2CppImage;
struct Il2CppObject;

namespace ta::adapters::unity::chams
{
    class ChamsShaderRepository final
    {
    public:
        [[nodiscard]] Il2CppObject* resolve(const Il2CppImage* unity_image, const char* shader_name);
        void reset() noexcept;

    private:
        const Il2CppImage* unity_image_ = nullptr;
        Il2CppObject* bundle_ = nullptr;
        Il2CppObject* shader_system_type_ = nullptr;
        std::unordered_map<std::string, Il2CppObject*> shaders_;
    };

    ChamsShaderRepository& shader_repository() noexcept;
}
