// 亲密度等级表
import { readFileAndParse } from '../util'
import { FILENAME } from '../../consts'

export interface DicRoleFriendLv {

    // id
    readonly id: number;
    // 亲密度等级
    readonly lv: number;
    // 亲密度值
    readonly value: number;
    // 亲密度总值
    readonly sum: number;
    // 寻宝加成
    readonly comBattleAdd: number;

}

export const dicRoleFriendLv = new Map<number, DicRoleFriendLv>();
export function loadRoleFriendLv() {
    dicRoleFriendLv.clear();
    
    let arr = readFileAndParse(FILENAME.DIC_ROLE_FRIEND_LEVEL);

    let sum = 0;

    arr.forEach(o => {
        sum += o.value;
        o.sum = sum;
        dicRoleFriendLv.set(o.lv, o);
    });
    
    arr = undefined;
}