抽卡:添加抽卡接口

This commit is contained in:
luying
2021-04-23 15:46:04 +08:00
parent 1f6839cafb
commit beadccf778
23 changed files with 591 additions and 85 deletions
@@ -1,5 +1,5 @@
import { readJsonFile, parseNumberList } from '../util'
import { FILENAME } from '../../consts'
import { FILENAME, GACHA_CONTENT_TYPE } from '../../consts'
export interface DicGachaContent {
// 内容id
@@ -15,9 +15,14 @@ export interface DicGachaContent {
const str = readJsonFile(FILENAME.DIC_GACHA_CONTENT);
let arr = JSON.parse(str);
export const dicGachaContent = new Map<number, DicGachaContent>();
export const dicGachaContent = new Map<number, DicGachaContent>(); // id => dic
export const dicGachaContentHero = new Map<number, number>(); // quality => dic
arr.forEach(o => {
o.param = parseNumberList(o.param);
if(o.type == GACHA_CONTENT_TYPE.HERO) {
dicGachaContentHero.set(o.param[0], o.id);
}
dicGachaContent.set(o.id, o);
});
arr = undefined;