forked from mirrors/webxoss-core
💫 implement card.beforeMove()
This commit is contained in:
parent
ca1ae1712e
commit
6e6f09b5e7
1 changed files with 6 additions and 0 deletions
6
Card.js
6
Card.js
|
@ -100,6 +100,9 @@ function Card (game,player,zone,pid,side) {
|
||||||
this.sideB = info.sideB? new Card(game,player,zone,info.sideB,this) : null;
|
this.sideB = info.sideB? new Card(game,player,zone,info.sideB,this) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 特殊钩子
|
||||||
|
this.beforeMove = info.beforeMove;
|
||||||
|
|
||||||
// Lostorage
|
// Lostorage
|
||||||
this.coin = info.coin || 0;
|
this.coin = info.coin || 0;
|
||||||
this.bet = info.bet || 0;
|
this.bet = info.bet || 0;
|
||||||
|
@ -1009,6 +1012,9 @@ Card.prototype.moveTo = function (zone,arg) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// 移动卡片
|
// 移动卡片
|
||||||
|
if (card.beforeMove) {
|
||||||
|
card.beforeMove()
|
||||||
|
}
|
||||||
removeFromArr(card,card.zone.cards);
|
removeFromArr(card,card.zone.cards);
|
||||||
card.isUp = arg.up;
|
card.isUp = arg.up;
|
||||||
card.isFaceup = arg.faceup;
|
card.isFaceup = arg.faceup;
|
||||||
|
|
Loading…
Reference in a new issue