
export enum ITEM_TYPE {
    Star = "Star",
    Coin = "Coin",
    Magnet = "Magnet",//磁铁
    Hint = "Hint", //提示
    Frozen = "Frozen",//冰冻
    Time = "Time"
}

export enum BOX_TYPE {
    LEVEL,
    STAR,
    TEAM
}

export type TItem = {
    type: ITEM_TYPE,
    num: number;
}

export default class GameConst {

    public static CLEAR_ALL_BOX = "CLEAR_ALL_BOX";
    public static USE_ITEM_HINT = "USE_ITEM_HINT";
    public static USE_ITEM_FROZEN = "USE_ITEM_FROZEN";
    public static USE_ITEM_TIME = "USE_ITEM_TIME";

    static getLvBoxReward(key: number) {
        if (key == 1) {
            return [{ type: ITEM_TYPE.Coin, num: 17 }, { type: ITEM_TYPE.Hint, num: 2 }]
        }
        else if (key == 2) {
            return [{ type: ITEM_TYPE.Coin, num: 20 }, { type: ITEM_TYPE.Hint, num: 3 }, { type: ITEM_TYPE.Magnet, num: 3 }]
        }
        else {
            return [{ type: ITEM_TYPE.Coin, num: 30 }, { type: ITEM_TYPE.Hint, num: 5 }, { type: ITEM_TYPE.Magnet, num: 5 }, { type: ITEM_TYPE.Time, num: 5 }]
        }
    }

    static getStarBoxReward(key: number) {
        if (key == 1) {
            return [{ type: ITEM_TYPE.Coin, num: 100 }, { type: ITEM_TYPE.Hint, num: 5 }]
        }
        else if (key == 2) {
            return [{ type: ITEM_TYPE.Coin, num: 150 }, { type: ITEM_TYPE.Hint, num: 5 }, { type: ITEM_TYPE.Magnet, num: 5 }]
        }
        else {
            return [{ type: ITEM_TYPE.Coin, num: 200 }, { type: ITEM_TYPE.Hint, num: 5 }, { type: ITEM_TYPE.Magnet, num: 5 }, { type: ITEM_TYPE.Time, num: 5 }]
        }
    }


    static getItemName(type: ITEM_TYPE) {
        return {
            "Star": "星星",
            "Coin": "金币",
            "Magnet": "磁铁",
            "Hint": "提示",
            "Frozen": "冰冻",
            "Time": "额外时间"
        }[type]
    }

    static local_data_key = "111"
    //游戏窗口层级
    static WIN_LAYER =
        {
            SCENE: 10,
            POPUP: 20,
            GUIDE: 30,
            TIP: 40,
            ERROR: 50,
            VIDEO: 60
        }
    //窗口类型
    static WIN_TYPE =
        {
            NORMAL: 1,//普通
            FULLSCREEN: 2,//全屏
            PERMANENT: 3,//常驻
        }


    static MAX_LIFE = 5;
    static MAX_LIFE_RECOVERY_TIME = 2;//分钟

}


export const ITEM_HINT_LV = 5;         //  提示
export const ITEM_FROZEN_LV = 10;    //    冰冻时间
//

export const ITEM_MAGENT_LV = 10;    //    磁铁
export const ITEM_TIME_LV = 20;      //    额外时间