29 lines
771 B
TypeScript
29 lines
771 B
TypeScript
// 公会权限
|
|
import { readJsonFile, parseGoodStr } from '../util'
|
|
import { FILENAME } from '../../consts'
|
|
import { RewardInter } from '../../pubUtils/interface';
|
|
|
|
export interface DicGuildAuction {
|
|
|
|
// 活动类型 1-蛮夷入侵 2-诸侯混战 3-粮草先行
|
|
readonly id: number;
|
|
// 最低名次
|
|
readonly min: number;
|
|
// 最高名次
|
|
readonly max: number;
|
|
// 奖励
|
|
readonly rewards: RewardInter[];
|
|
}
|
|
|
|
const str = readJsonFile(FILENAME.DIC_GUILD_AUCTION);
|
|
let arr = JSON.parse(str);
|
|
|
|
export const dicGuildAuction = new Map<number, DicGuildAuction[]>();
|
|
|
|
arr.forEach(o => {
|
|
o.rewards = parseGoodStr(o.rewards);
|
|
let rank = dicGuildAuction.get(o.id)||[];
|
|
rank.push(o);
|
|
dicGuildAuction.set(o.id, rank);
|
|
});
|
|
arr = undefined; |