后台:json上传
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
// 藏宝图掉落率
|
||||
import { decodeArrayListStr, readJsonFile } from '../util'
|
||||
import { decodeArrayListStr, readFileAndParse } from '../util'
|
||||
import { FILENAME } from '../../consts'
|
||||
|
||||
export interface DicBlueprtPossibility {
|
||||
@@ -13,14 +13,15 @@ export interface DicBlueprtPossibility {
|
||||
|
||||
}
|
||||
|
||||
const str = readJsonFile(FILENAME.DIC_BLUEPRT_POSSIBILITY);
|
||||
let arr = JSON.parse(str);
|
||||
|
||||
export const dicBlueprtPossibility = new Array<DicBlueprtPossibility>();
|
||||
arr.forEach(o => {
|
||||
o.possibility = parsePossibility(o.possibility);
|
||||
dicBlueprtPossibility.push(o);
|
||||
});
|
||||
export function loadBlueprtPossibility() {
|
||||
|
||||
let arr = readFileAndParse(FILENAME.DIC_BLUEPRT_POSSIBILITY);
|
||||
arr.forEach(o => {
|
||||
o.possibility = parsePossibility(o.possibility);
|
||||
dicBlueprtPossibility.push(o);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function parsePossibility(str: string) {
|
||||
|
||||
Reference in New Issue
Block a user