// 百家学宫列表
import { readFileAndParse, parseNumberList } from '../util'
import { FILENAME } from '../../consts'

export interface DicSchool {

    // 学宫id
    readonly id: number;
    // 学宫名
    readonly name: string;
    // 提升属性
    readonly upAttribute: Array<number>;
}

export const dicSchool = new Map<number, DicSchool>();
export function loadSchool() {
    dicSchool.clear();
    
    let arr = readFileAndParse(FILENAME.DIC_SCHOOL);

    arr.forEach(o => {
        o.upAttribute = parseNumberList(o.upAttribute)
        dicSchool.set(o.id, o);
    });
    
    arr = undefined;
}