名将擂台:刷新对手
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
// 名将擂台匹配范围
|
||||
import { parseNumberList, readFileAndParse} from '../util'
|
||||
import { FILENAME } from '../../consts'
|
||||
|
||||
export interface DicLadderMatch {
|
||||
// id
|
||||
readonly id: number;
|
||||
// 最低排名
|
||||
readonly rankMin: number;
|
||||
// 最高排名
|
||||
readonly rankMax: number;
|
||||
// 玩家随机范围往前数最多多少人
|
||||
readonly rangeBeforeMax: number;
|
||||
// 玩家随机范围往后数最多多少人
|
||||
readonly rangeAfterMax: number;
|
||||
// 玩家随机范围往前随多少人
|
||||
readonly rangeBeforeNum: number;
|
||||
// 玩家随机范围往后随多少人
|
||||
readonly rangeAfterNum: number;
|
||||
// 玩家随机间隔
|
||||
readonly gap: { min: number, max: number };
|
||||
// 是否可以挑战前十
|
||||
readonly topChallenge: number;
|
||||
}
|
||||
|
||||
export const dicLadderMatch: DicLadderMatch[] = [];
|
||||
export function loadLadderMatch() {
|
||||
dicLadderMatch.splice(0, dicLadderMatch.length);
|
||||
|
||||
let arr = readFileAndParse(FILENAME.DIC_LADDER_MATCH);
|
||||
arr.forEach(o => {
|
||||
o.gap = parseGap(o.interval);
|
||||
dicLadderMatch.push(o);
|
||||
});
|
||||
arr = undefined;
|
||||
}
|
||||
|
||||
function parseGap(str: string) {
|
||||
let arr = parseNumberList(str);
|
||||
return { min: arr[0], max: arr[1] }
|
||||
}
|
||||
Reference in New Issue
Block a user