提交 bccd2f07 编写于 作者: 微笑面对bug's avatar 微笑面对bug

AI 延时

上级 e3844a90
...@@ -39,12 +39,15 @@ class Player{ ...@@ -39,12 +39,15 @@ class Player{
playByAI(){ playByAI(){
let lastObj = this.getLastObj(); let that = this;
if(lastObj){ setTimeout(function () {
this.playByObj(lastObj); let lastObj = that.getLastObj();
}else{ if(lastObj){
this.playByAllType(); that.playByObj(lastObj);
} }else{
that.playByAllType();
}
},1000);
} }
...@@ -818,11 +821,21 @@ class Player{ ...@@ -818,11 +821,21 @@ class Player{
} }
playByPokerList(pokerList){ playByPokerList(pokerList){
if(this.game.currentPlayer!==this){
alert('请等待 '+this.game.currentPlayer.name+' 出牌');
return false;
}
let list = this.getListByList(pokerList); let list = this.getListByList(pokerList);
return this.handleList(list); return this.handleList(list);
} }
playByString(str){ playByString(str){
if(this.game.currentPlayer!==this){
alert('请等待 '+this.game.currentPlayer.name+' 出牌');
return false;
}
let list = this.getListByString(str); let list = this.getListByString(str);
return this.handleList(list); return this.handleList(list);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册