feat(宝物): 添加宝物系统

This commit is contained in:
luying
2022-12-07 10:55:30 +08:00
parent b684307818
commit a83deeff5f
46 changed files with 15656 additions and 54 deletions

View File

@@ -745,6 +745,15 @@ export function addToMap<T>(map: Map<T, number>, id: T, value: number) {
}
}
export function arrToMap<T>(arr: T[], getKey: (obj: T) => number): Map<number, T> {
let map = new Map();
for(let obj of arr) {
let key = getKey(obj);
map.set(key, obj);
}
return map;
}
// /**
// * 计算最强阵容战力
// * @param role