import { GameConfig } from "../Config/GameConfig";
import HttpUtil from "../Crypto/HttpUtil";
import AudioManager from "../Music/AudioManager";

import { Notifications } from "../Notification/Notification";
import { StorageMessage } from "../Storage/Storage";
import { GameTool } from "../Tool/GameTool";

window.initMgr = function() {
    if(cc.fx)
    {
        return;
    }
    cc.fx = {};
    console.log("初始化");
    //基础状态信息
    cc.fx.StateInfo = {
        debugMode: true,
        networkConnected: true,   //网络状态
        networkType: 'none',      //网络类型
        isOnForeground: true      //当前是否是在前台
    };

    //应用系统信息
    //配置文件
    cc.fx.GameConfig = GameConfig;
    cc.fx.HttpUtil = HttpUtil;
    cc.fx.GameTool = GameTool;
    cc.fx.AudioManager = AudioManager;
    cc.fx.Notifications = Notifications;
    cc.fx.StorageMessage = StorageMessage;

    cc.fx.ShareInfo = {
        queryId : -1              //分享id
    };

    /*
        * 客户端埋点分享类型
    */
    cc.fx.BurialShareType = {
        Default : "default",        //默认分享类型,分享到群
        Invite : "invite",          // 邀请好友

        DailyInviteRoomJoin:'invite_join_room', //邀请好友加入
        DailyInviteFriend : 'invite_friend', // 日常邀请好友
        DailyInviteGroup : 'invate_group', // 日常分享群
        DailyInviteGroupAlive: 'invate_alive', //日常分享群复活
        DailyInviteGroupReward: 'invate_rewared',//分享奖励翻倍
        DailyInviteGroupBox: 'invate_box',  //宝箱分享奖励
        DailyInviteGroupBall: 'invate_ball',  //分享领取球球

        MatchResult : 'matchResult',  // 比赛结算分享
        MatchFix5: 'MatchFix5',                          // 5元红包赛
        MatchFix20: 'MatchFix20',                        // 20元红包赛
        MatchFix100: 'MatchFix100',                      // 100元红包赛
        MatchFix500: 'MatchFix500',                      // 500元红包赛
        NewerRedEnvelope: 'newerRedEnvelope',            // 新手红包
        CoinRoomResult: 'coinRoomResult',                // 金币桌结算
        HighRate : "highRate",//高倍分享
        CoinRoomWinStreak: 'coinRoomWinStreak',         // 连胜
        CoinRoomBankruptcy1: 'coinRoomBankruptcy1',         // 金币桌破产
        CoinRoomBankruptcy2: 'coinRoomBankruptcy2',         // 金币桌破产
        CoinRoomBankruptcy3: 'coinRoomBankruptcy3',         // 金币桌破产
    };

    /*
     * 分享到哪儿给奖励 group frined all
     */
    cc.fx.ShareWhereReward = {
        Group :"group", //微信群
        Friend : "friend",//好友
        All : "all", //不区分
    };


    //暂时不用
    cc.fx.clickStatEventType = {
        clickStatEventTypeVideoAD : 20173201,//视频播放完成
        clickStatEventTypeClickAdVideo : 20173202,//视频播放为完成
        clickStatEventTypeBannerAD : 20173203,//banner播放为完成
        clickStatEventTypeUserFrom : 99990001,//用户来源
        clickStatEventTypeShare : 99990002,//用户分享
        clickStatEventTypeClickAdBtn : 99990007,//点击分流icon
        clickStatEventTypeBannerAD2 : 67890033, // banner广告干预
        clickStatEventTypeSubmitVersionInfo : 9999, //上报微信版本及基础库信息
        clickStatEventTypeClickFirstAd : 99990003, //分流icon显示
        clickStatEventTypeClickSecondAd : 99990004, //玩家点击分流按钮
        clickStatEventTypeWxLoginStart : 10001,//微信登录开始
        clickStatEventTypeWxLoginSuccess : 10002,//微信登录成功
        clickStatEventTypeWxLoginFailed : 10003,//微信登录失败
        clickStatEventTypeAuthorizationStart : 10003,//授权开始
        clickStatEventTypeAuthorizationSuccess : 10004,//授权成功
        clickStatEventTypeAuthorizationFailed : 10005,//授权失败
        clickStatEventTypeLoginSDKStart : 10007,//登录SDK开始
        clickStatEventTypeLoginSDKSuccess : 10008,//登录SDK成功
        clickStatEventTypeLoginSDKFailed : 10009,//登录SDK时失败
        clickStatEventTypeTCP_Start : 10009,//TCP连接开始
        clickStatEventTypeTCP_Success : 10010,//TCP连接成功
        clickStatEventTypeTCP_Failed : 10011,//TCP连接失败
    };

};