// 公会权限
import { readFileAndParse, parseNumberList } from '../util'
import { FILENAME } from '../../consts'

export interface DicGuildAuth {

    // id
    readonly id: number;
    // 权限
    readonly authority: number[];

}

export const dicGuildAuth = new Map<number, number[]>();
export function loadGuildAuth() {
    dicGuildAuth.clear();
    let arr = readFileAndParse(FILENAME.DIC_GUILD_AUTH);

    arr.forEach(o => {
        let authority = parseNumberList(o.authority)
        dicGuildAuth.set(o.id, authority);
    });
    arr = undefined;
}