排行榜:一览&领取
This commit is contained in:
@@ -71,6 +71,8 @@ import { decodeIdCntArrayStr, parseGoodStr, decodeArrayListStr, getRandValueByMi
|
||||
import { RACE_EVENT_TYPE } from "../consts";
|
||||
import { dicShop, dicShopItem } from "./dictionary/DicShop";
|
||||
import { dicShopList } from "./dictionary/DicShopList";
|
||||
import { dicRank } from "./dictionary/DicRank";
|
||||
import { dicRankReward } from "./dictionary/DicRankReward";
|
||||
|
||||
export const gameData = {
|
||||
blurprtCompose: dicBlueprtCompose,
|
||||
@@ -167,7 +169,9 @@ export const gameData = {
|
||||
shop: dicShop,
|
||||
shopItem: dicShopItem,
|
||||
shopList: dicShopList,
|
||||
dicMyHeroes: dicMyHeroes
|
||||
dicMyHeroes: dicMyHeroes,
|
||||
rank: dicRank,
|
||||
generalRankReward: dicRankReward
|
||||
};
|
||||
|
||||
// 在此提供一些原先在gamedata中提供的方法,以便更方便获取gameData数据
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
// 排行榜表
|
||||
import { readJsonFile } from '../util'
|
||||
import { FILENAME } from '../../consts'
|
||||
|
||||
export interface DicRank {
|
||||
|
||||
// 排行榜id
|
||||
readonly id: number;
|
||||
// 属于哪个页签
|
||||
readonly group: number;
|
||||
// 总览中的位置
|
||||
readonly general: number;
|
||||
|
||||
}
|
||||
|
||||
|
||||
const str = readJsonFile(FILENAME.DIC_RANK);
|
||||
let arr = JSON.parse(str);
|
||||
|
||||
export const dicRank = new Array<DicRank>();
|
||||
|
||||
arr.forEach(o => {
|
||||
dicRank.push(o);
|
||||
});
|
||||
|
||||
arr = undefined;
|
||||
@@ -0,0 +1,30 @@
|
||||
// 排行榜奖励表
|
||||
import { readJsonFile, parseGoodStr } from '../util'
|
||||
import { FILENAME } from '../../consts'
|
||||
import { RewardInter } from '../interface';
|
||||
|
||||
export interface DicRankReward {
|
||||
|
||||
// 奖励id
|
||||
readonly id: number;
|
||||
// 排行榜id
|
||||
readonly rankId: number;
|
||||
// 条件
|
||||
readonly condition: number;
|
||||
// 奖励
|
||||
readonly reward: Array<RewardInter>;
|
||||
|
||||
}
|
||||
|
||||
|
||||
const str = readJsonFile(FILENAME.DIC_RANK_REWARD);
|
||||
let arr = JSON.parse(str);
|
||||
|
||||
export const dicRankReward = new Map<number, DicRankReward>();
|
||||
|
||||
arr.forEach(o => {
|
||||
o.reward = parseGoodStr(o.reward);
|
||||
dicRankReward.set(o.id, o);
|
||||
});
|
||||
|
||||
arr = undefined;
|
||||
Reference in New Issue
Block a user