import { readFileAndParse } from '../util';
import { GACHA_FLOOR_TYPE, FILENAME } from '../../consts';

export interface DicGachaFloor {
    // 保底id
    readonly id: number;
    // 类型
    readonly floorType: GACHA_FLOOR_TYPE;
    // 目标武将品质
    readonly heroQuality: number;
    // 参数
    readonly param: number;
}

export const dicGachaFloor = new Map<number, DicGachaFloor>(); // floorId => plans
export function loadGachaFloor() {
    dicGachaFloor.clear();
    let arr = readFileAndParse(FILENAME.DIC_GACHA_FLOOR);

    arr.forEach(o => {
        dicGachaFloor.set(o.id, o);
    });
    
    arr = undefined;
}