后台:json上传
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
// 商店表
|
||||
import { readJsonFile, parseNumberList } from '../util'
|
||||
import { readFileAndParse, parseNumberList } from '../util'
|
||||
import { FILENAME } from '../../consts'
|
||||
|
||||
export interface DicShopList {
|
||||
@@ -13,14 +13,14 @@ export interface DicShopList {
|
||||
readonly money: number[];
|
||||
}
|
||||
|
||||
|
||||
const str = readJsonFile(FILENAME.DIC_SHOP_LIST);
|
||||
let arr = JSON.parse(str);
|
||||
|
||||
export const dicShopList = new Map<number, DicShopList>();
|
||||
export function loadShopList() {
|
||||
let arr = readFileAndParse(FILENAME.DIC_SHOP_LIST);
|
||||
|
||||
arr.forEach(o => {
|
||||
o.type = parseNumberList(o.typeid);
|
||||
o.money = parseNumberList(o.moneyid);
|
||||
dicShopList.set(o.shopid, o);
|
||||
});
|
||||
arr.forEach(o => {
|
||||
o.type = parseNumberList(o.typeid);
|
||||
o.money = parseNumberList(o.moneyid);
|
||||
dicShopList.set(o.shopid, o);
|
||||
});
|
||||
arr = undefined;
|
||||
}
|
||||
Reference in New Issue
Block a user