#pragma once
#include <string>

#include "Core/Models.h"
#include "Core/RuntimeSession.h"
#include "Memory/VmmAccessor.h"

// -------------------------------------------------------------------------
// LocalPlayerResolver
// Resolves the local player entity from the world's LocalPlayer pointer
// and reads its transform (position + heading).
// -------------------------------------------------------------------------

class LocalPlayerResolver {
public:
    /// Attempt to resolve and populate @p player.
    /// Returns true only when all required reads succeed and the position
    /// passes the IsValidVector check.
    bool TryResolve(VmmAccessor& mem, const RuntimeSession& session, LocalPlayerData& player);

    [[nodiscard]] const std::string& LastFailureReason() const noexcept {
        return m_lastFailureReason;
    }

private:
    std::string m_lastFailureReason;
};
