#pragma once

#include <mutex>
#include <string>

#include "adapters/unity/bindings/UnityTypes.h"
#include "adapters/il2cpp/Il2CppCollections.h"
#include "adapters/unity/bindings/UnityApi.h"

namespace ta::adapters::eft::aimbot
{
    struct TargetState
    {
        bool has_target = false;
        ta::adapters::unity::vector3 target{};
        std::string local_nickname;
    };

    class TargetStateStore final
    {
    public:
        static TargetStateStore& instance();

        TargetState snapshot() const;
        void set_local_nickname(std::string nickname);
        void set_target(ta::adapters::unity::vector3 target);
        void clear_target();
        void reset();

    private:
        TargetStateStore() = default;

        mutable std::mutex mutex_;
        TargetState state_{};
    };
}
