#pragma once

#include "foundation/diagnostics/Metrics.h"

namespace ta::features::world
{
    struct WorldDiagnosticsSnapshot final
    {
        ta::foundation::diagnostics::RequestConsumeSnapshot unlock_doors;
        ta::foundation::diagnostics::RequestConsumeSnapshot item_teleport;
    };

    class WorldDiagnostics final
    {
    public:
        void mark_unlock_requested() noexcept { unlock_doors_.mark_requested(); }
        void mark_unlock_consumed() noexcept { unlock_doors_.mark_consumed(); }
        void mark_teleport_requested() noexcept { item_teleport_.mark_requested(); }
        void mark_teleport_consumed() noexcept { item_teleport_.mark_consumed(); }
        void reset() noexcept { unlock_doors_.reset(); item_teleport_.reset(); }
        [[nodiscard]] WorldDiagnosticsSnapshot snapshot() const noexcept
        { return {unlock_doors_.snapshot(), item_teleport_.snapshot()}; }

    private:
        ta::foundation::diagnostics::RequestConsumeMetrics unlock_doors_;
        ta::foundation::diagnostics::RequestConsumeMetrics item_teleport_;
    };
}
