namespace Thousandto.CoreSDK
{
    /// <summary>
    /// 数据统计类
    /// 1. 游戏内的数据统计都从这里分发下去,到Android和IOS去处理
    /// 2. 这里统计类型存放在FunctionEnum文件的DataTypes枚举中,新增类型在枚举中添加后再做对应处理
    /// </summary>
    public abstract class SDKStatistics
    {
        //数据统计提交的接口
        public static string STATISTICS_URL = "sts/rpt.do";

        private static SDKStatistics _instance;
        public static SDKStatistics Instance
        {
            get
            {
                if (_instance == null)
                {
#if UNITY_EDITOR
                    _instance = new SDKStatisticsDefault();
#elif UNITY_ANDROID
                    _instance = new SDKStatisticsAndroid();
#elif UNITY_IPHONE
                    _instance = new SDKStatisticsIOS();
#elif UNITY_STANDALONE_WIN
                    _instance = new SDKStatisticsPC();
#else
                    _instance = new SDKStatisticsDefault();
#endif
                }

                return _instance;
            }
        }

        /// <summary>
        /// 游戏内基本的统计,对应的事件完成情况
        /// </summary>
        /// <param name="funcType">数据统计的类型,新增类型在枚举中添加后再做对应处理</param>
        /// <param name="jsonParam">需要的数据</param>
        public abstract void StatisticalEvent(DataTypes funcType, string jsonParam);
    }
}