//
// Created by sebastian on 30.07.26.
//
// AssetRequests.cpp

#include "AssetRequests.h"

#include <format>
#include <type_traits>

#include "RawAssetData.h"
#include "loader/AssetLoader.h"


namespace engine {

    std::string assetRequestToString(
        const AssetRequest& request)
    {
        return std::visit(
            [](auto const& req)
            {
                using Type = std::decay_t<decltype(req)>;


                if constexpr(std::is_same_v<Type, TextureRequest>)
                {
                    return std::format(
                        "TextureRequest{{name='{}', path='{}'}}",
                        req.name,
                        req.path
                    );
                } else if constexpr(std::is_same_v<Type, ModelRequest>)
                {
                    return std::format(
                        "ModelRequest{{name='{}', path='{}'}}",
                        req.name,
                        req.path
                    );
                } else if constexpr(std::is_same_v<Type, SoundRequest>){
                   return std::format(
                       "SoundRequest{{name='{}', path='{}'}}",
                        req.name,
                        req.path);
                }
            },
            request);
    }

}
