✨ feat(宝物): 添加宝物系统
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user