using AOT;
using PlayPcSdkManaged.Unity.Helpers;
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

namespace PlayPcSdkManaged.Unity.Recall
{
    public class UnityGameRecallCallbacksHandler : IGamesRecallCallbacksHandler
    {
        public GameRequestRecallAccessContinuation RequestRecallAccessCallback => RequestRecallAccessnComplete;

        [MonoPInvokeCallback(typeof(GameRequestRecallAccessContinuation))]
        private static void RequestRecallAccessnComplete(
            IntPtr context, GamesRecallResult result,
            RecallAccessResultValue resultValue)
        {
            var continuation = UnityCallbacksHelper.GetContinuation<RequestRecallAccessContinuation>(context);
            continuation?.Invoke(ModelConversionsGameRecall.FromInternal(result, resultValue));
        }
    }
}
