using BingoBrain.HotFix;

namespace BingoBrain.Core
{
    public class UserInfo
    {
        public string userId;
    }

    /// <summary>
    /// 全局应用
    /// 应用层逻辑注入到框架层
    /// </summary>
    public static class Pva
    {
        #region User

        public static UserInfo UserInfo;

        #endregion User

        #region Application

        private static Bea _sCurrBea = null;

        public static void Congds(Bea bea)
        {
            _sCurrBea = bea;
            _sCurrBea.Init();
            _sCurrBea.Enable();
        }

        public static void Restart()
        {
            _sCurrBea.Restart();
        }

        public static void Quit()
        {
            _sCurrBea.Quit();
        }

        #endregion Application

        #region UIMsg

        private static float LoadingProgressDelayTime = 0f;

        public static void Enter()
        {
            AppDispatcher.Instance.Dispatch(CsjInfoC.UI_DisplayLoadingUI);
        }

        public static void HideLoadingUI(bool isDelay = false)
        {
            if (!isDelay)
            {
                AppDispatcher.Instance.Dispatch(CsjInfoC.UI_HideLoadingUI);
                return;
            }

            TimerHelper.mEasy.AddTimer(0.5f, () => { AppDispatcher.Instance.Dispatch(CsjInfoC.UI_HideLoadingUI); });
        }

        #endregion UIMsg
    }
}