
import { MiniGameSdk } from "../../Sdk/MiniGameSdk";
import { GameTool } from "../Tool/GameTool";


const { ccclass, property } = cc._decorator;
@ccclass('GameConfig')
export class GameConfig {
    //所有控制信息都通过GameAppStart内控制
    private static _instance: GameConfig = null;

    static GAME_DATA: any[];
    //关卡数据
    //用户需要存储在本地的数据， 金币，关卡等级，体力值以及恢复，道具数量。


    static CUSTOM_INFO: {
        moveSpeed: number; //洪峰移动速度
        waitTime: number; //洪峰冲击倒计时
        fastPath: number; //最短路径
    }[];
    static TIME_INFO: {
        waterSpeed: number[]; //洪峰速度
        totalTime: number; //游戏总时长
        waterTime: number[]; //洪峰来的倒计时
        roadSpeed: number; //河道修筑速度
        ReinforceSpeed: number; //加固时间速度
        Xi_SoilSpeed: number;
    };
    //用于盛放埋点数据上传，每次上传后清空
    static CLICK_DATA: {
        type: number; //上传数据类型
        success: boolean; //此局游戏正确与否
        round: number; //回合数轮次
        getScore: number; //本轮得分，失败为0分
        cumulativeScore: number; //本剧游戏总计得分
        mapId: string; //地图ID
        difficulty: number; //地图难度
        optimizedSteps: number; //关卡最短步数
        usedSteps: number; //玩家修建总步数
        stepList: any[]; //U、D、L、R   X 息壤   F 加固
        startTime: number; //从游戏开始到玩家操作的第一步截止时间  单位毫秒
        submitTime: number; //从第一步操作到提交时间，如果未提交为-1 单位毫秒
        duration: number; //游戏总用时（截止到提交） 单位毫秒
        drawingBack: number; //后退次数
        drawingReset: number; //清空次数
        timer: number;  //游戏倒计时剩余时长 秒
    };

    static TIP_ERR: string[];   //修筑失败错误提示

    static BLOCK_INFO: {}[][];
    //static WALL_INFO: ({ id: number; num: number; block: number; color: number; type: number; special: number; length: number; }[] | { id: number; num: number; block: number; color: number; type: number; special: number; }[])[];
    static LEVEL_INFO: ({ id: string; map: number[]; risefall?: undefined; gap?: undefined; } | { id: string; map: number[]; risefall: { pos: cc.Vec2; color: number; }[]; gap?: undefined; } | { id: string; map: number[]; gap: cc.Vec2[]; risefall?: undefined; })[];
    static WALL_INFO: (({ id: number; num: number; block: number; color: number; special: number; length: number; lock?: undefined; } | { id: number; num: number; block: number; color: number; special: number; length: number; lock: boolean; })[] | ({ id: number; num: number; block: number; color: number; special: number; length: number; freeze?: undefined; } | { id: number; num: number; block: number; color: number; special: number; length: number; freeze: number; })[])[];
    static PROP_INFO: ({ pos1: { x: number; y: number; z: number; }; pos2: { x: number; y: number; z: number; }; pos3: { x: number; y: number; z: number; }; pos4: { x: number; y: number; z: number; }; pos5: { x: number; y: number; z: number; }; pos6: { x: number; y: number; z: number; }; } | { pos1: { x: number; y: number; z: number; }; pos2: { x: number; y: number; z: number; }; pos3: { x: number; y: number; z: number; }; pos4: { x: number; y: number; z: number; }; pos5: { x: number; y: number; z: number; }; pos6?: undefined; })[];
    static NEW_LEVEL: any;
    static NEW_GUIDE: any;

    static TA: any;
    static GE: any;


    static DAILY_SHARE_LIMITS = {
        health: 2,               //获得体力每日分享限制次数
        hammer: 2,               //获得锤子道具每日分享限制次数
        freeze: 2,               //获得冰冻时间道具每日分享限制次数
        magicWand: 2,            //获得魔棒道具每日分享限制次数
        reviveTime: 0,           //复活加时间道具每日分享限制次数
        removeBomb: 0,           //复活移除炸弹道具每日分享限制次数
        openDoor: 0,             //把门打开道具每日分享限制次数
        removeJam: 0             //弹走果酱道具每日分享限制次数
    };
    static GM_INFO: {
        // isEnd: false,    
        mean_Time: number; //平均放箭速度
        hp: number; //体力值
        review: number; //复活次数
        reviewBoom: number; //炸弹复活次数
        reviewDoor: number; //门复活次数
        currSeed: number; //用于随机数种子
        openid: string; //微信用户唯一id
        gameId: string; //游戏ID
        userId: number; //用户ID
        scode: string; //用户code,从网页后缀获取
        username: string; //用户名称
        useravatar: string; //用户头像地址
        useravatarIcon: string; //用户头像
        useravaterkuang: string; //用户头像框
        guide: boolean; //是否有引导
        url: string; //访问域名
        coin: number; //用户金币
        success: boolean; //用户游戏成功与否
        matchId: any; //用于埋点上传的ID
        gameState: boolean; custom: number; //用于测试跳关卡
        round: number; //回合数
        level: number; //具体游戏内进行到第几步 
        stepTimeList: number; //整局游戏用时，由于涉及场景切换，数据需要保留
        successList: any[]; //整局胜负
        first: boolean; //是否首次进入游戏
        score: number; //总得分
        scale: number; //玩家总计成功点火数
        allOutTradeNo: any[]; //订单号数组
        min_Time: number; //体力恢复的剩余时间
        freezeAmount: number; //冻结道具次数
        hammerAmount: number; //锤子道具次数
        magicAmount: number; //魔法棒道具次数
        musicOpen: boolean; //音乐
        effectOpen: boolean; //音效
        vibrateOpen: boolean; //震动
        coinnum: number; //每局的金币数
        paid_user: boolean; //是否是付费用户
        version: number; //版本号
        shushu_DistinctId: string; //数数访客ID
        shushu_AccountId: string; //数数账号ID
        uid: string; //用户和后端唯一id
        userPowerTime: number; //用户体力恢复时间
        freezeFirst: boolean; //冻结道具第一次
        hammerFirst: boolean; //锤子道具第一次
        magicAFirst: boolean; //魔法棒道具第一次
        winStreakFirst: boolean; //每次第一次连胜
        hp_Max: number; //体力最大值    
        doubleCoin: number; //是否双倍
        // monthTime: 0,               //月卡时间
        // revive: 0,                   //复活礼包购买次数
        otherUid: string; //其他被帮助用户id
        otherLevel: number; //其他被帮助用户等级
        helpLevel: number; //帮助用户等级
        iosShopOrder: string; //ios订单号商城
        // iosMonthOrder: "",          //ios订单号月卡
        iosReviveOrder: string; //ios订单号复活
        iosStarterOrder: string; //ios订单号新手
        starter_packTime: number; //新手礼包活动时间
        wxFriend: boolean; //微信好友信息授权
        wxUserInfo: boolean; //微信用户信息授权
        winState: boolean; //是否延续连胜状态
        winStreak: number; //连胜
        tasks: { levelPass: { value: number; target: number; state: number; }; share: { value: number; target: number; state: number; }; useEnergy: { value: number; target: number; state: number; }; useProp: { value: number; target: number; state: number; }; }; openHeath: boolean; dailyShareCounts: {
            health: number; //获得体力已分享次数
            hammer: number; //获得锤子道具已分享次数
            freeze: number; //获得冰冻时间道具已分享次数
            magicWand: number; //获得魔棒道具已分享次数
            reviveTime: number; //复活加时间道具已分享次数
            removeBomb: number; //复活移除炸弹道具已分享次数
            openDoor: number; //把门打开道具已分享次数
            removeJam: number; //弹走果酱道具已分享次数
        };
        videoTime: number;
    };




    //游戏内信息

    static get Instance() {
        if (this._instance == null) {
            this._instance = new GameConfig();
        }
        return this._instance;
    }
    //getSeedRandom
    static init(Authentication) {
        //@ts-ignore

        this.TA = null;
        this.CLICK_init();
        this.GM_INFO_init();
        this.LEVEL_INFO_init(false, 0);

        var self = this;
        //GAME_DATA 废弃了，暂时不删除以防后面修改回 一整局传一次
        this.GAME_DATA = [
        ]


        // if(!Authentication) self.Authentication();
    }



    static generateUUID(): string {
        return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
            const r = Math.random() * 16 | 0;
            const v = c === 'x' ? r : (r & 0x3 | 0x8);
            return v.toString(16);
        });
    }

    // 版本比较函数
    static compareVersion(v1: string, v2: string): number {
        const arr1 = v1.split('.');
        const arr2 = v2.split('.');
        const len = Math.max(arr1.length, arr2.length);

        for (let i = 0; i < len; i++) {
            const num1 = parseInt(arr1[i] || '0', 10);
            const num2 = parseInt(arr2[i] || '0', 10);
            if (num1 > num2) {
                return 1;
            } else if (num1 < num2) {
                return -1;
            }
        }

        return 0;
    }

    static GM_INFO_SET(key, value) {
        this.GM_INFO[key] = value;
    }
    static CLICK_init() {
        this.CLICK_DATA =
        {
            type: 1,            //上传数据类型
            success: false,     //此局游戏正确与否
            round: 0,           //回合数轮次
            getScore: 0,        //本轮得分，失败为0分
            cumulativeScore: 0, //本剧游戏总计得分
            mapId: "",          //地图ID
            difficulty: 0,      //地图难度
            optimizedSteps: 0,  //关卡最短步数
            usedSteps: 0,       //玩家修建总步数
            stepList: [],       //U、D、L、R   X 息壤   F 加固
            startTime: -1,        //从游戏开始到玩家操作的第一步截止时间  单位毫秒
            submitTime: -1,       //从第一步操作到提交时间，如果未提交为-1 单位毫秒
            duration: 0,         //游戏总用时（截止到提交） 单位毫秒 如果未他移交则为时间上限
            drawingBack: 0,      //后退次数
            drawingReset: 0,     //清空次数
            timer: 0           //测评倒计时剩余时间 去秒

        }
    }

    static CLICK_SET(key, value) {
        this.CLICK_DATA[key] = value;
    }

    //数据备用
    static GM_INFO_init() {
        this.GM_INFO = {
            // isEnd: false,    
            mean_Time: 0,               //平均放箭速度
            hp: 3,                      //体力值
            review: 0,                    //复活次数
            reviewBoom: 0,              //炸弹复活次数
            reviewDoor: 0,              //门复活次数
            currSeed: 200000,           //用于随机数种子
            openid: "",                  //微信用户唯一id
            gameId: "100001",           //游戏ID
            userId: 0,                  //用户ID
            scode: "",                  //用户code,从网页后缀获取
            username: "user",                //用户名称
            useravatar: "",              //用户头像地址
            useravatarIcon: "icon_0",          //用户头像
            useravaterkuang: "kuang_1",          //用户头像框
            guide: true,                 //是否有引导
            url: "https://api.sparkus.cn",//访问域名
            coin: 0,                    //用户金币
            success: false,             //用户游戏成功与否
            matchId: null,              //用于埋点上传的ID
            gameState: false,
            custom: 0,                  //用于测试跳关卡
            round: 0,                    //回合数
            level: 0,                    //具体游戏内进行到第几步 
            stepTimeList: 0,             //整局游戏用时，由于涉及场景切换，数据需要保留
            successList: [],              //整局胜负
            first: false,                      //是否首次进入游戏
            score: 0,                    //总得分
            scale: 1,             //玩家总计成功点火数
            allOutTradeNo: [],                //订单号数组
            min_Time: 0,                  //体力恢复的剩余时间
            freezeAmount: 0,              //冻结道具次数
            hammerAmount: 0,              //锤子道具次数
            magicAmount: 0,               //魔法棒道具次数
            musicOpen: true,             //音乐
            effectOpen: true,             //音效
            vibrateOpen: true,           //震动
            coinnum: 0,               //每局的金币数
            paid_user: false,           //是否是付费用户
            version: 1.5,               //版本号
            shushu_DistinctId: "",      //数数访客ID
            shushu_AccountId: "",       //数数账号ID
            uid: "",                    //用户和后端唯一id
            userPowerTime: 0,           //用户体力恢复时间
            freezeFirst: false,         //冻结道具第一次
            hammerFirst: false,         //锤子道具第一次
            magicAFirst: false,         //魔法棒道具第一次
            winStreakFirst: false,       //每次第一次连胜
            hp_Max: 3,                  //体力最大值    
            doubleCoin: 1,           //是否双倍
            // monthTime: 0,               //月卡时间
            // revive: 0,                   //复活礼包购买次数
            otherUid: "",               //其他被帮助用户id
            otherLevel: 0,              //其他被帮助用户等级
            helpLevel: 0,               //帮助用户等级
            iosShopOrder: "",           //ios订单号商城
            // iosMonthOrder: "",          //ios订单号月卡
            iosReviveOrder: "",          //ios订单号复活
            iosStarterOrder: "",        //ios订单号新手
            starter_packTime: 0,         //新手礼包活动时间
            wxFriend: false, //微信好友信息授权
            wxUserInfo: false, //微信用户信息授权
            winState: false, //是否延续连胜状态
            winStreak: 0, //连胜
            tasks: { levelPass: { value: 0, target: 0, state: 0 }, share: { value: 0, target: 0, state: 0 }, useEnergy: { value: 0, target: 0, state: 0 }, useProp: { value: 0, target: 0, state: 0 } },
            openHeath: false,
            dailyShareCounts: {
                health: 0,               //获得体力已分享次数
                hammer: 0,               //获得锤子道具已分享次数
                freeze: 0,               //获得冰冻时间道具已分享次数
                magicWand: 0,            //获得魔棒道具已分享次数
                reviveTime: 0,           //复活加时间道具已分享次数
                removeBomb: 0,           //复活移除炸弹道具已分享次数
                openDoor: 0,             //把门打开道具已分享次数
                removeJam: 0             //弹走果酱道具已分享次数
            },
            videoTime: 0,               //视频广告播放时间
        };
        // this.setCode(this.getKey("scode"));
        // this.GM_INFO.level = 0;


        cc.resources.load("Json/NEW_LEVEL", (err: any, res: cc.JsonAsset) => {
            if (err) {
                console.error("加载 NEW_LEVEL.JSON 失败:", err);
                return;
            }
            const newLevelData = res.json;
            this.NEW_LEVEL = newLevelData.NEW_LEVEL;
            // 可以根据需求对 newLevelData 进行处理
            // //console.log("NEW_LEVEL.JSON 加载成功:", newLevelData);
        })
        cc.resources.load("Json/NEW_GUIDE", (err: any, res: cc.JsonAsset) => {
            if (err) {
                console.error("加载 NEW_GUIDE.JSON 失败:", err);
                return;
            }
            const newLevelData = res.json;
            this.NEW_GUIDE = newLevelData.NEW_GUIDE;
            // 可以根据需求对 newLevelData 进行处理
            // //console.log("NEW_GUIDE.JSON 加载成功:", newLevelData);
        })
    }


    static LEVEL_INFO_init(type, time) {
        // 示例         围墙会根据缺的地块自动生成
        // 带缺口       {"id":"1006","map":[10,11],"gap":[cc.v2(4,9),cc.v2(5,9)]},
        // 带升降地块   {"id":"1004","map":[7,8],"risefall":[{pos:cc.v2(5,4),color:2},{pos:cc.v2(5,5),color:5}]},
        // 如果普通的就  {"id":"1001","map":[6,7]}, 这个样子就可以了
        var self = this;


        if (cc.fx.GameTool.maxLevel()) {
            MiniGameSdk.API.showToast("关卡每周更新，敬请期待！");
            return;
        }
        let name = "Json/level" + (cc.fx.GameConfig.GM_INFO.level + 1);
        if (cc.fx.GameConfig.GM_INFO.otherLevel > 0) {
            console.log("进入特殊帮助关卡，可越过自己关卡等级");
            name = "Json/level" + cc.fx.GameConfig.GM_INFO.otherLevel;
        }

        let bundleName = "custom"; // 替换为实际的分包名称
        cc.assetManager.loadBundle(bundleName, (err: Error, bundle: cc.AssetManager.Bundle) => {
            if (err) {
                return;
            }
            bundle.load(name, cc.JsonAsset, (err: Error, res: cc.JsonAsset) => {
                if (err) {
                    console.log("没有这个关卡:", name);
                    cc.fx.GameTool.addLevel(null, null);
                    self.LEVEL_INFO_init(type, time);
                    return;
                }
                let jsonData: object = res.json!;
                self.BLOCK_INFO = jsonData["BLOCK_INFO"];
                self.LEVEL_INFO = jsonData["LEVEL_INFO"];
                self.WALL_INFO = jsonData["WALL_INFO"];
                // //console.log("配置加载完成"); 
                if (type) {
                    cc.director.preloadScene("GameScene", () => {
                        if (time == 0) cc.director.loadScene("GameScene");
                        else {
                            setTimeout(() => {
                                cc.director.loadScene("GameScene");
                            }, time);
                        }
                    })
                }
            });
        });

        // //console.log("关卡名称:",name);
        // name = "Json/level" + 68;
        // cc.fx.StorageMessage.setStorage("level",cc.fx.GameConfig.GM_INFO.level.toString());
        // cc.resources.load(name, (err: any, res: cc.JsonAsset) => {
        //     if (err) {
        //         console.log("没有这个关卡:", name)
        //         cc.fx.GameTool.addLevel(null, null);
        //         self.LEVEL_INFO_init(type, time);
        //         return;
        //     }
        //     let jsonData: object = res.json!;
        //     self.BLOCK_INFO = jsonData["BLOCK_INFO"];
        //     self.LEVEL_INFO = jsonData["LEVEL_INFO"];
        //     self.WALL_INFO = jsonData["WALL_INFO"];
        //     // //console.log("配置加载完成"); 
        //     if (type) {
        //         cc.director.preloadScene("GameScene", () => {
        //             if (time == 0) cc.director.loadScene("GameScene");
        //             else {
        //                 setTimeout(() => {
        //                     cc.director.loadScene("GameScene");
        //                 }, time);
        //             }
        //         })
        //     }

        // })


        //道具位置信息
        this.PROP_INFO = [
            {
                "pos1": { "x": -66, "y": 60, "z": 0 },
                "pos2": { "x": -19, "y": 36, "z": 0 },
                "pos3": { "x": -34.362, "y": 13.246, "z": 0 },
                "pos4": { "x": -17, "y": 12, "z": 0 },
                "pos5": { "x": -85, "y": 70, "z": 0 },
                "pos6": { "x": -5, "y": 3, "z": 0 },
            },
            {
                "pos1": { "x": -126, "y": 61, "z": 0 },
                "pos2": { "x": -25.792, "y": 34.675, "z": 0 },
                "pos3": { "x": -94.792, "y": 21.675, "z": 0 },
                "pos4": { "x": -20, "y": 13, "z": 0 },
                "pos5": { "x": -140, "y": 68, "z": 0 },
                "pos6": { "x": -2, "y": 0, "z": 0 },
            },
            {
                "pos1": { "x": -67, "y": 122, "z": 0 },
                "pos2": { "x": -20, "y": 94, "z": 0 },
                "pos3": { "x": -34.792, "y": 23.675, "z": 0 },
                "pos4": { "x": -14, "y": 24, "z": 0 },
                "pos5": { "x": -84, "y": 128, "z": 0 },
                "pos6": { "x": -5, "y": 3, "z": 0 },
            },
            {
                "pos1": { "x": -178, "y": 61, "z": 0 },
                "pos2": { "x": -34.792, "y": 37.675, "z": 0 },
                "pos3": { "x": -150, "y": 23.675, "z": 0 },
                "pos4": { "x": -22, "y": 16, "z": 0 },
                "pos5": { "x": -200, "y": 67, "z": 0 },
                "pos6": { "x": 0, "y": 0, "z": 0 },
            },
            {
                "pos1": { "x": -63, "y": 178, "z": 0 },
                "pos2": { "x": -17.792, "y": 166.675, "z": 0 },
                "pos3": { "x": -31.792, "y": 33.675, "z": 0 },
                "pos4": { "x": -14, "y": 37, "z": 0 },
                "pos5": { "x": -78, "y": 182, "z": 0 },
                "pos6": { "x": 0, "y": 2, "z": 0 },
            },
            {
                "pos1": { "x": -123, "y": 124, "z": 0 },
                "pos2": { "x": -25.792, "y": 99.675, "z": 0 },
                "pos3": { "x": -97.792, "y": 27.675, "z": 0 },
                "pos4": { "x": -27, "y": 19, "z": 0 },
                "pos5": { "x": -135, "y": 127, "z": 0 },
                "pos6": { "x": 0, "y": 0, "z": 0 },
            },
            {
                "pos1": { "x": -64, "y": 178, "z": 0 },
                "pos2": { "x": -24.792, "y": 275.675, "z": 0 },
                "pos3": { "x": -31.792, "y": 35.675, "z": 0 },
                "pos4": { "x": -7, "y": 39, "z": 0 },
                "pos5": { "x": -77, "y": 188, "z": 0 },
                "pos6": { "x": 0, "y": 0, "z": 0 },
            },
            {
                "pos1": { "x": -178, "y": 186, "z": 0 },
                "pos2": { "x": -31.792, "y": 163.675, "z": 0 },
                "pos3": { "x": -33.792, "y": 34.675, "z": 0 },
                "pos4": { "x": -18, "y": 30, "z": 0 },
                "pos5": { "x": -200, "y": 192, "z": 0 },
                "pos6": { "x": 0, "y": 5, "z": 0 },
            },
            {
                "pos1": { "x": -186, "y": 178, "z": 0 },
                "pos2": { "x": -25.792, "y": 38.675, "z": 0 },
                "pos3": { "x": -153.792, "y": 34.675, "z": 0 },
                "pos4": { "x": -23, "y": 14, "z": 0 },
                "pos5": { "x": -200, "y": 185, "z": 0 },
                "pos6": { "x": 0, "y": 0, "z": 0 },
            },
            {
                "pos1": { "x": -183, "y": 64, "z": 0 },
                "pos2": { "x": -37.792, "y": 37.675, "z": 0 },
                "pos3": { "x": -36.792, "y": 26.675, "z": 0 },
                "pos4": { "x": -24, "y": 17, "z": 0 },
                "pos5": { "x": -212, "y": 74, "z": 0 },
                "pos6": { "x": 0, "y": 0, "z": 0 },
            },
            {
                "pos1": { "x": -65, "y": 177, "z": 0 },
                "pos2": { "x": 93.208, "y": 276.675, "z": 0 },
                "pos3": { "x": -33.792, "y": 34.675, "z": 0 },
                "pos4": { "x": 3, "y": 31, "z": 0 },
                "pos5": { "x": -80, "y": 190, "z": 0 },
                "pos6": { "x": 0, "y": 3, "z": 0 },
            },
            {
                "pos1": { "x": 58, "y": 179, "z": 0 },
                "pos2": { "x": 205.225, "y": 154.034, "z": 0 },
                "pos3": { "x": -29.642, "y": 25.691, "z": 0 },
                "pos4": { "x": 7.218, "y": 29.765, "z": 0 },
                "pos5": { "x": 45, "y": 185, "z": 0 },
                "pos6": { "x": 0, "y": 0, "z": 0 },
            },
            {
                "pos1": { "x": -68, "y": 182, "z": 0 },
                "pos2": { "x": -25.792, "y": 37.675, "z": 0 },
                "pos3": { "x": -35.792, "y": 33.675, "z": 0 },
                "pos4": { "x": -14, "y": 12, "z": 0 },
                "pos5": { "x": -82, "y": 190, "z": 0 },
                "pos6": { "x": -2, "y": 1, "z": 0 },
            },
            {
                "pos1": { "x": -184, "y": 62, "z": 0 },
                "pos2": { "x": -35.792, "y": 36.675, "z": 0 },
                "pos3": { "x": -271.792, "y": 24.675, "z": 0 },
                "pos4": { "x": -17, "y": 20, "z": 0 },
                "pos5": { "x": -200, "y": 72, "z": 0 },
                "pos6": { "x": 0, "y": 0, "z": 0 },
            },
            {
                "pos1": { "x": -62, "y": 175, "z": 0 },
                "pos2": { "x": 87.208, "y": 164.675, "z": 0 },
                "pos3": { "x": -31.792, "y": 35.675, "z": 0 },
                "pos4": { "x": -6, "y": 24, "z": 0 },
                "pos5": { "x": -79, "y": 172, "z": 0 },
                "pos6": { "x": 0, "y": 5, "z": 0 },
            },
            {
                "pos1": { "x": -184, "y": 72, "z": 0 },
                "pos2": { "x": -33.792, "y": 38.675, "z": 0 },
                "pos3": { "x": -154.792, "y": 29.675, "z": 0 },
                "pos4": { "x": -29, "y": 16, "z": 0 },
                "pos5": { "x": -201, "y": 85, "z": 0 },
                "pos6": { "x": -1, "y": 3, "z": 0 },
            },
            {
                "pos1": { "x": -64, "y": 181, "z": 0 },
                "pos2": { "x": 95.208, "y": 155.675, "z": 0 },
                "pos3": { "x": -30.792, "y": 36.675, "z": 0 },
                "pos4": { "x": -12, "y": 32, "z": 0 },
                "pos5": { "x": -78, "y": 190, "z": 0 },
                "pos6": { "x": 0, "y": 3, "z": 0 },
            },
            {
                "pos1": { "x": -65, "y": 178, "z": 0 },
                "pos2": { "x": -21.792, "y": 156.675, "z": 0 },
                "pos3": { "x": -31.792, "y": 37.675, "z": 0 },
                "pos4": { "x": -12, "y": 32, "z": 0 },
                "pos5": { "x": -78, "y": 188, "z": 0 },
                "pos6": { "x": 0, "y": 2, "z": 0 },
            },
            {
                "pos1": { "x": -62, "y": 183, "z": 0 },
                "pos2": { "x": 88.208, "y": 162.675, "z": 0 },
                "pos3": { "x": -29.792, "y": 41.675, "z": 0 },
                "pos4": { "x": -12, "y": 18, "z": 0 },
                "pos5": { "x": -80, "y": 188, "z": 0 },
                "pos6": { "x": -4, "y": 2, "z": 0 },
            },
            {
                "pos1": { "x": -67, "y": 80, "z": 0 },
                "pos2": { "x": -26.792, "y": 32.675, "z": 0 },
                "pos3": { "x": -34.792, "y": 23.675, "z": 0 },
                "pos4": { "x": -12, "y": 18, "z": 0 },
                "pos5": { "x": -84, "y": 90, "z": 0 },
                "pos6": { "x": 0, "y": 0, "z": 0 },
            },
            {
                "pos1": { "x": -184, "y": 80, "z": 0 },
                "pos2": { "x": -25.792, "y": 34.675, "z": 0 },
                "pos3": { "x": -155.792, "y": 25.675, "z": 0 },
                "pos4": { "x": -18, "y": 26, "z": 0 },
                "pos5": { "x": -196, "y": 96, "z": 0 },
                "pos6": { "x": 0, "y": 0, "z": 0 },
            },
            {
                "pos1": { "x": -62, "y": 160, "z": 0 },
                "pos2": { "x": 95.208, "y": 158.675, "z": 0 },
                "pos3": { "x": -33.792, "y": 29.675, "z": 0 },
                "pos4": { "x": -18, "y": 26, "z": 0 },
                "pos5": { "x": -78, "y": 170, "z": 0 },
                "pos6": { "x": 0, "y": 2, "z": 0 },
            },
            {
                "pos1": { "x": -68, "y": 160, "z": 0 },
                "pos2": { "x": -25.792, "y": 156.675, "z": 0 },
                "pos3": { "x": -35.792, "y": 27.675, "z": 0 },
                "pos4": { "x": -25, "y": 40, "z": 0 },
                "pos5": { "x": -82, "y": 170, "z": 0 },
                "pos6": { "x": -2, "y": 2, "z": 0 },
            }
        ];
        // this.PROP_INFO = [{"pos1": {"x": -60,"y": 60,"z": 0},"pos2": {"x": -16.442,"y": 30,"z": 0},"pos3": {"x": -34.362,"y": 13.246,"z": 0},"pos4": {"x": -17,"y": 12,"z": 0}},{"pos1": {"x": -126,"y": 63,"z": 0},"pos2": {"x": -25.792,"y": 34.675,"z": 0},"pos3": {"x": -94.792,"y": 21.675,"z": 0},"pos4": {"x": -20,"y": 13,"z": 0}},{"pos1": {"x": -60,"y": 125,"z": 0},"pos2": {"x": -12.792,"y": 92.675,"z": 0},"pos3": {"x": -34.792,"y": 23.675,"z": 0},"pos4": {"x": -14,"y": 24,"z": 0}},{"pos1": {"x": -185,"y": 63,"z": 0},"pos2": {"x": -34.792,"y": 37.675,"z": 0},"pos3": {"x": -154.792,"y": 23.675,"z": 0},"pos4": {"x": -22,"y": 16,"z": 0}},{"pos1": {"x": -57,"y": 178,"z": 0},"pos2": {"x": -17.792,"y": 166.675,"z": 0},"pos3": {"x": -31.792,"y": 33.675,"z": 0},"pos4": {"x": -14,"y": 37,"z": 0}},{"pos1": {"x": -123,"y": 127,"z": 0},"pos2": {"x": -25.792,"y": 99.675,"z": 0},"pos3": {"x": -97.792,"y": 27.675,"z": 0},"pos4": {"x": -27,"y": 19,"z": 0}},{"pos1": {"x": -62,"y": 181,"z": 0},"pos2": {"x": -24.792,"y": 275.675,"z": 0},"pos3": {"x": -31.792,"y": 35.675,"z": 0},"pos4": {"x": -7,"y": 39,"z": 0}},{"pos1": {"x": -181,"y": 180,"z": 0},"pos2": {"x": -31.792,"y": 163.675,"z": 0},"pos3": {"x": -33.792,"y": 34.675,"z": 0},"pos4": {"x": -18,"y": 30,"z": 0}},{"pos1": {"x": -182,"y": 182,"z": 0},"pos2": {"x": -25.792,"y": 38.675,"z": 0},"pos3": {"x": -153.792,"y": 34.675,"z": 0},"pos4": {"x": -23,"y": 14,"z": 0}},{"pos1": {"x": -186,"y": 61,"z": 0},"pos2": {"x": -37.792,"y": 37.675,"z": 0},"pos3": {"x": -36.792,"y": 26.675,"z": 0},"pos4": {"x": -24,"y": 17,"z": 0}},{"pos1": {"x": -62,"y": 177,"z": 0},"pos2": {"x": 93.208,"y": 276.675,"z": 0},"pos3": {"x": -33.792,"y": 34.675,"z": 0},"pos4": {"x": 3,"y": 31,"z": 0}},{"pos1": {"x": 58,"y": 179,"z": 0},"pos2": {"x": 205.225,"y": 154.034,"z": 0},"pos3": {"x": -29.642,"y": 25.691,"z": 0},"pos4": {"x": 7.218,"y": 29.765,"z": 0}},{"pos1": {"x": -57,"y": 182,"z": 0},"pos2": {"x": -25.792,"y": 37.675,"z": 0},"pos3": {"x": -35.792,"y": 33.675,"z": 0},"pos4": {"x": -14,"y": 12,"z": 0}},{"pos1": {"x": -180,"y": 62,"z": 0},"pos2": {"x": -35.792,"y": 36.675,"z": 0},"pos3": {"x": -271.792,"y": 24.675,"z": 0},"pos4": {"x": -17,"y": 20,"z": 0}},{"pos1": {"x": -62,"y": 178,"z": 0},"pos2": {"x": 87.208,"y": 164.675,"z": 0},"pos3": {"x": -31.792,"y": 35.675,"z": 0},"pos4": {"x": -6,"y": 24,"z": 0}},{"pos1": {"x": -176,"y": 60,"z": 0},"pos2": {"x": -33.792,"y": 38.675,"z": 0},"pos3": {"x": -154.792,"y": 29.675,"z": 0},"pos4": {"x": -29,"y": 16,"z": 0}},{"pos1": {"x": -60,"y": 181,"z": 0},"pos2": {"x": 95.208,"y": 155.675,"z": 0},"pos3": {"x": -30.792,"y": 36.675,"z": 0},"pos4": {"x": -12,"y": 32,"z": 0}},{"pos1": {"x": -63,"y": 178,"z": 0},"pos2": {"x": -21.792,"y": 156.675,"z": 0},"pos3": {"x": -31.792,"y": 37.675,"z": 0},"pos4": {"x": -12,"y": 32,"z": 0}},{"pos1": {"x": -60,"y": 183,"z": 0},"pos2": {"x": 88.208,"y": 162.675,"z": 0},"pos3": {"x": -29.792,"y": 41.675,"z": 0},"pos4": {"x": -12,"y": 18,"z": 0}},{"pos1": {"x": -64,"y": 58,"z": 0},"pos2": {"x": -26.792,"y": 32.675,"z": 0},"pos3": {"x": -34.792,"y": 23.675,"z": 0},"pos4": {"x": -12,"y": 18,"z": 0}},{"pos1": {"x": -184,"y": 62,"z": 0},"pos2": {"x": -25.792,"y": 34.675,"z": 0},"pos3": {"x": -155.792,"y": 25.675,"z": 0},"pos4": {"x": -18,"y": 26,"z": 0}},{"pos1": {"x": -57,"y": 190,"z": 0},"pos2": {"x": 95.208,"y": 158.675,"z": 0},"pos3": {"x": -33.792,"y": 29.675,"z": 0},"pos4": {"x": -18,"y": 26,"z": 0}},{"pos1": {"x": -71,"y": 184,"z": 0},"pos2": {"x": -25.792,"y": 156.675,"z": 0},"pos3": {"x": -35.792,"y": 27.675,"z": 0},"pos4": {"x": -25,"y": 40,"z": 0}}];
    }



    static setCode(code) {
        this.GM_INFO.scode = code;
    }

    static getKey(key) {
        // var reg = new RegExp('(^|&)' + key + '=([^&]*)(&|$)', 'i');
        // var r = window.location.search.substring(1).match(reg);
        // if (r != null) {
        //     return unescape(r[2]);
        // }
        return "";
    }


    static Authentication() {
        cc.fx.GameTool.Authentication();
    }
}

