// 排行榜表
import { readFileAndParse } from '../util'
import { FILENAME } from '../../consts'

export interface DicRecruit {

    // id
    readonly id: number;
    // 武将id
    readonly actorId: number;
    // 权重
    readonly weight: number;
    // 是否可以拜访
    readonly canVisit: number;
    // 是否可以许愿
    readonly canHope: number;

}

export const dicRecruit = new Map<number, DicRecruit>();
export function loadRecruit() {
    dicRecruit.clear();
    let arr = readFileAndParse(FILENAME.DIC_RECRUIT);

    arr.forEach(o => {
        dicRecruit.set(o.actorId, o);
    });
    
    arr = undefined;
}