Optimize game.expandSkills.
(cherry picked from commit fcc1d48119587ec9bb7a1e5f2470ee7c3dd3c1cb)
This commit is contained in:
parent
71a801e279
commit
b6ca7b534e
21
game/game.js
21
game/game.js
|
@ -38698,22 +38698,15 @@
|
||||||
}
|
}
|
||||||
return out;
|
return out;
|
||||||
},
|
},
|
||||||
expandSkills:function(skills){
|
expandSkills:skills=>skills.addArray(skills.reduce((previousValue,currentValue)=>{
|
||||||
var skills2=[];
|
const info=get.info(currentValue);
|
||||||
for(var i=0;i<skills.length;i++){
|
|
||||||
var info=get.info(skills[i]);
|
|
||||||
if(info){
|
if(info){
|
||||||
if(info.group) skills2=skills2.concat(info.group);
|
if(Array.isArray(info.group)) previousValue.push(...info.group);
|
||||||
|
else if(info.group) previousValue.push(info.group);
|
||||||
}
|
}
|
||||||
else{
|
else console.log(currentValue);
|
||||||
console.log(skills[i]);
|
return previousValue;
|
||||||
}
|
},[])),
|
||||||
}
|
|
||||||
for(var i=0;i<skills2.length;i++){
|
|
||||||
skills.add(skills2[i]);
|
|
||||||
}
|
|
||||||
return skills;
|
|
||||||
},
|
|
||||||
css:style=>Object.keys(style).forEach(value=>{
|
css:style=>Object.keys(style).forEach(value=>{
|
||||||
let uiStyle=ui.style[value];
|
let uiStyle=ui.style[value];
|
||||||
if(!uiStyle){
|
if(!uiStyle){
|
||||||
|
|
Loading…
Reference in New Issue