// 礼包奖励表
import { readFileAndParse } from '../util';
import { FILENAME } from '../../consts';

// 礼包保底表
export interface DicGiftPackageFloor {
    // 唯一id
    readonly id: number;
    // 触发保底次数
    readonly times: number;
    // 品质（触发多保底时的优先级覆盖关系）
    readonly quality: number;
}

export const dicGiftPackageFloor = new Map<number, DicGiftPackageFloor>(); // floorId => [floor]
export function loadGiftPackageFloor() {
    dicGiftPackageFloor.clear();
    let arr = readFileAndParse(FILENAME.DIC_GIFT_PACKAGE_FLOOR);
    arr.forEach(o => {
        dicGiftPackageFloor.set(o.id, o);
    });
    arr = undefined;
}