import { _decorator } from 'cc';
const { ccclass, property } = _decorator;

export class config {
    static debug = true;
    static domain = config.debug ? "https://zcapi.xwrun.com" : "https://zcapi.hainanmlwl.com";
    static static_domain = config.debug ? "https://zcapi.xwrun.com" : "https://zaoca.oss-cn-beijing.aliyuncs.com";
    static statistics_domain = config.debug ? "http://logads.xwrun.com" : "https://logads.hainanmlwl.com";
    static version = "v1.0.0";
    static hav_no_allAd = false;
    static static_url = {
        category: "/zcstatic/category.json", //玩法静态接口
        user_test: "/zcstatic/user_test.json", //测试用户
        levels: (category_id, page) => {
            return `/zcstatic/levels/${category_id}_${page}.json`; //关卡列表-双图对比找不同
        },
        levels_info: (category_id, id) => {
            return `/zcstatic/levels_info/${category_id}_${id}.json`; //玩法详情
        }
    };
    static api_url = {
        login: "/user/login",
        get_open_id: "/dyin/get_open_id",
        sync_data: "/user/sync_data",
        can_ju: "/ending/index",
        sign_status: "/user/sign_status",
    }
    static statistics_url = {
        rewardVideo_data: '/zcadspush',
    }

    static EVENT_MSG = {
        ON_INIT_GAME_LIST: "ON_INIT_GAME_LIST",
        ON_CHANGE_COIN_NUMBER: "ON_CHANGE_COIN_NUMBER",
        ON_BACK_HOME_VIEW: "ON_BACK_HOME_VIEW",
        ON_UPDATE_HOME_VIEW: "ON_UPDATE_HOME_VIEW",
        ON_SHOW_REWARD_VIEW: "ON_SHOW_REWARD_VIEW",
        ON_USER_LOGIN_SUCCESS: "ON_USER_LOGIN_SUCCESS"
    }

    static PREFAB_PATH = {
        play_list_item: "prefabs/play_list_item",
        play_page_list_item: "prefabs/play_page_list_item",
        game_play_shuang_tu_zhao_bu_tong: "prefabs/game_play_shuang_tu_zhao_bu_tong",
        game_play_han_zi_zhao_bu_tong: "prefabs/game_play_han_zi_zhao_bu_tong",
        game_play_mei_nv_zhao_xi_jie: "prefabs/game_play_mei_nv_zhao_xi_jie",
        setting: "prefabs/setting",
        unlock_play_dialog: "prefabs/unlock_play_dialog",
        view_loading: "prefabs/view_loading",
        toast: "prefabs/toast",
        dialog: "prefabs/dialog",
        Lack: "prefabs/Lack",
        circle: "prefabs/circle",
        guid: "prefabs/guid",
        win: "prefabs/win",
        fail: "prefabs/fail",
        pause: "prefabs/pause",
        game_play_dou_di_zhu: "prefabs/game_play_dou_di_zhu",
        game_play_shuang_tu_zhao_xiang_tong: "prefabs/game_play_shuang_tu_zhao_xiang_tong",
        game_play_ji_yi_li: "prefabs/game_play_ji_yi_li",
        game_play_zhao_bu_tong: "prefabs/game_play_zhao_bu_tong",
        reward_box_page: "prefabs/reward_box_page",
    }

    static MSG_CODE = {
        SUCCESS: 10000,
    }

    static PLAY_TYPE = {
        YI_QI_ZHAO_CHA: 1,
        HAN_ZI_ZHAO_BU_TONG: 2,
        MEI_NV_ZHAO_XI_JIE: 3,
        ZHAO_XIANG_TONG: 6,
        ZHAO_BU_TONG: 7,
        DOU_DI_ZHU: 8,
        JI_YI_LI: 9,
    }

    static get_play_type_name(play_type:number):string {
        var play_type_string = ''
        switch (play_type) {
            case config.PLAY_TYPE.YI_QI_ZHAO_CHA:
                play_type_string = '一起来找茬'
                break;
            case config.PLAY_TYPE.HAN_ZI_ZHAO_BU_TONG:
                play_type_string = '找找谁不同'
                break; 
            case config.PLAY_TYPE.MEI_NV_ZHAO_XI_JIE:
                play_type_string = '美女找细节'
                break;
            case config.PLAY_TYPE.ZHAO_XIANG_TONG:
                play_type_string = '疯狂找相同'
                break;
            case config.PLAY_TYPE.ZHAO_BU_TONG:
                play_type_string = '谁带了口罩'
                break;
            case config.PLAY_TYPE.DOU_DI_ZHU:
                play_type_string = '斗地主残局'
                break;
            case config.PLAY_TYPE.JI_YI_LI:
                play_type_string = '考考记忆力'
                break;
            default:
                break;
        }
        return play_type_string
    }

    static ABCD_LIST = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'];

    static USER_ID = "USER_ID"
    static POOL_KEY = "font_item"
    static MP3_PATH = {
        BGM_MUSIC: "bg_music",
        SOUND_BTN: "sound_btn",
        SOUND_ERR: "sound_err",
        SOUND_FAIL: "sound_fail",
        SOUND_RIGHT: "sound_right",
        SOUND_WIN: "sound_win",
    }

    static rewardVideoAdUnitId = {
        Earn_coins_AdUnitId: "5rl14207ajg50uh3mh", //赚金币-激励视频
        Tip_AdUnitId: "2ys751adu3106j544k", //提示-激励视频
        Prolong_AdUnitId: "562cehe6a7k24i74a7", //延长时间-激励视频
        Super_double_AdUnitId: "6g0edggi82lh3dk933", //超级加倍-激励视频
        Resume_AdUnitId: "8d19519ih5ab5msq6n",//重新开始-激励视频
    }

    static EnvCard2RealCard = {
        3: '3', 4: '4', 5: '5', 6: '6', 7: '7',
        8: '8', 9: '9', 10: 'T', 11: 'J', 12: 'Q',
        13: 'K', 14: 'A', 17: '2', 20: 'X', 30: 'D'
    };
    static ddz_res_path = "ddz/"

    static fullDoudizhuDeckIndex = {
        X: 54,
        D: 53,
        S2: 52,
        C2: 51,
        H2: 50,
        D2: 49,
        SA: 48,
        CA: 47,
        HA: 46,
        DA: 45,
        SK: 44,
        CK: 43,
        HK: 42,
        DK: 41,
        SQ: 40,
        CQ: 39,
        HQ: 38,
        DQ: 37,
        SJ: 36,
        CJ: 35,
        HJ: 34,
        DJ: 33,
        ST: 32,
        CT: 31,
        HT: 30,
        DT: 29,
        S9: 28,
        C9: 27,
        H9: 26,
        D9: 25,
        S8: 24,
        C8: 23,
        H8: 22,
        D8: 21,
        S7: 20,
        C7: 19,
        H7: 18,
        D7: 17,
        S6: 16,
        C6: 15,
        H6: 14,
        D6: 13,
        S5: 12,
        C5: 11,
        H5: 10,
        D5: 9,
        S4: 8,
        C4: 7,
        H4: 6,
        D4: 5,
        S3: 4,
        C3: 3,
        H3: 2,
        D3: 1,
    };
    static MIN_SINGLE_CARDS = 5;// 最小的连组合
    static MIN_PAIRS = 3;  // 最小的连队组合
    static MIN_TRIPLES = 2; // 最小的飞机组合

    //# action types
    static TYPE_0_PASS = 0
    static TYPE_1_SINGLE = 1
    static TYPE_2_PAIR = 2
    static TYPE_3_TRIPLE = 3
    static TYPE_4_BOMB = 4
    static TYPE_5_KING_BOMB = 5
    static TYPE_6_3_1 = 6
    static TYPE_7_3_2 = 7
    static TYPE_8_SERIAL_SINGLE = 8 //顺子
    static TYPE_9_SERIAL_PAIR = 9 // 2连对
    static TYPE_10_SERIAL_TRIPLE = 10 // 飞机
    static TYPE_11_SERIAL_3_1 = 11
    static TYPE_12_SERIAL_3_2 = 12
    static TYPE_13_4_2 = 13
    static TYPE_14_4_22 = 14
    static TYPE_15_WRONG = 15

    public static sync_data_type = {
        ALL: 0,
        COIN: 1,
        LEVELS: 2,
    }
    
    static STATISTICS_ACTION_TYPE = {
        UNKNOWN: 0,            //未知
        ZHUAN_JIN_BI: 1,       //赚金币
        JIE_SUO: 2,            //解锁
        YAN_CHANG: 3,          //延长
        CHONG_XIN_KAI_SHI: 4,  //重新开始
        TI_SHI: 5,             //提示
        CHAO_JI_JIA_BEI: 6,    //超级加倍
    }

    static SIGN_STATUS_TYPE = {
        GET: 0,
        SYNC: 1,
    }

}


