Optimize game.asyncDraw.
(cherry picked from commit 5bec139ebd9a42cff403d0c48f6f67c7772d07ba)
This commit is contained in:
parent
4f1dd2610c
commit
44d95a70b7
30
game/game.js
30
game/game.js
|
@ -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);
|
||||||
|
|
Loading…
Reference in New Issue