// 好友表
import { readFileAndParse } from '../util'
import { FILENAME } from '../../consts'

export interface DicRoleFriend {

    // id
    readonly id: number;
    // 主公等级
    readonly lv: number;
    // 好友数量
    readonly frdCnt: number;
    // 每日可收取好友情谊点上限
    readonly receiveMax: number;
    // 每日可赠送好友情谊点上限
    readonly sendMax: number;

}

export const dicRoleFriend = new Map<number, DicRoleFriend>();
export function loadRoleFriend() {
    dicRoleFriend.clear();
    
    let arr = readFileAndParse(FILENAME.DIC_ROLE_FRIEND);

    arr.forEach(o => {
        dicRoleFriend.set(o.lv, o);
    });
    
    arr = undefined;
}