//
// Created by sebastian on 30.07.26.
//

#ifndef COLORRACE_ASSETFORMATTERS_H
#define COLORRACE_ASSETFORMATTERS_H
#pragma once

#include "AssetRequests.h"
#include "AssetTypes.h"

#include <format>


template<>
struct std::formatter<engine::AssetRequest>
{
    constexpr auto parse(
        std::format_parse_context& ctx)
    {
        return ctx.begin();
    }


    auto format(
        const engine::AssetRequest& request,
        std::format_context& ctx) const
    {
        return std::format_to(
            ctx.out(),
            "{}",
            engine::assetRequestToString(request)
        );
    }
};


template<>
struct std::formatter<engine::TextureType>
{
    constexpr auto parse(
        std::format_parse_context& ctx)
    {
        return ctx.begin();
    }


    auto format(
        engine::TextureType type,
        std::format_context& ctx) const
    {
        return std::format_to(
            ctx.out(),
            "{}",
            engine::toString(type)
        );
    }
};
#endif //COLORRACE_ASSETFORMATTERS_H
