using UnityEngine;
using EventsAppQuest.Application.Services;
using EventsAppQuest.Core;

namespace EventsAppQuest.Infrastructure.Services
{
    /// <summary>
    /// Avalia a prontidão do runtime Quest: build (editor ou Android), dados da apresentação, fallback e controles.
    /// </summary>
    public class MockQuestRuntimeReadinessService : IQuestRuntimeReadinessService
    {
        public QuestRuntimeReadinessStatus EvaluateReadiness(QuestPresentationSession session)
        {
            var status = new QuestRuntimeReadinessStatus();

#if UNITY_ANDROID && !UNITY_EDITOR
            status.IsBuildReady = true;
            status.Notes = "Build Android/Quest";
#else
            status.IsBuildReady = true;
            status.Notes = Application.isEditor ? "Editor (teste)" : "Runtime";
#endif

            status.HasPresentationData = session != null && session.IsPresentationReady;
            status.HasFallbackMode = true;
            status.HasNavigationControls = true;

            if (!status.HasPresentationData && session?.MRPlan != null)
                status.Notes = (status.Notes ?? "") + (string.IsNullOrEmpty(status.Notes) ? "" : " | ") + "Sem dados suficientes";
            return status;
        }
    }
}
