Optimize game.asyncDraw.

(cherry picked from commit 5bec139ebd9a42cff403d0c48f6f67c7772d07ba)
This commit is contained in:
Tipx-L 2023-08-24 21:10:17 -07:00
parent 4f1dd2610c
commit 44d95a70b7
1 changed files with 9 additions and 21 deletions

View File

@ -37431,27 +37431,15 @@
_status.pileTop=top; _status.pileTop=top;
},game.roundNumber,ui.cardPile.childNodes.length,ui.cardPile.firstChild); },game.roundNumber,ui.cardPile.childNodes.length,ui.cardPile.firstChild);
}, },
asyncDraw:function(players,num,drawDeck,bottom){ asyncDraw:(players,num,drawDeck,bottom)=>players.forEach((value,index)=>{
for(var i=0;i<players.length;i++){ let num2=1;
var num2=1; if(typeof num=='number') num2=num;
if(typeof num=='number'){ else if(Array.isArray(num)) num2=num[index];
num2=num; else if(typeof num=='function') num2=num(value);
} if(drawDeck&&drawDeck.drawDeck) value.draw(num2,false,drawDeck);
else if(Array.isArray(num)){ else if(bottom) value.draw(num2,'nodelay','bottom');
num2=num[i]; else value.draw(num2,'nodelay');
} }),
else if(typeof num=='function'){
num2=num(players[i]);
}
if(drawDeck&&drawDeck.drawDeck){
players[i].draw(num2,false,drawDeck);
}
else{
if(bottom) players[i].draw(num2,'nodelay','bottom');
else players[i].draw(num2,'nodelay');
}
}
},
asyncDrawAuto:function(players,num,drawDeck){ asyncDrawAuto:function(players,num,drawDeck){
if(players.length>1){ if(players.length>1){
game.asyncDraw.apply(this,arguments); game.asyncDraw.apply(this,arguments);