// 每日总表
import { readFileAndParse, parseNumberList } from '../util'
import { FILENAME } from '../../consts'

export interface DicDaily {
    // 每日类型
    readonly dailyType: number;
    // 每日类型名称
    readonly name: string;
    // 每天可以挑战的次数
    readonly timesPerDay: number;
    // 每天可以购买的次数
    readonly timesCanBuy: number;
    // 难度
    readonly difficultLvl: Array<number>;

}

export const dicDaily = new Array<DicDaily>();
export function loadDaily() {
    dicDaily.splice(0, dicDaily.length);
    let arr = readFileAndParse(FILENAME.DIC_DAILY);
    
    arr.forEach(o => {
        o.difficultLvl = parseNumberList(o.difficultLvl);
        dicDaily.push(o);
    });
    arr = undefined;
}