mirror of
https://github.com/webxoss/webxoss-core.git
synced 2025-01-18 19:56:02 +01:00
💫 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.beforeMove = info.beforeMove;
|
||||
|
||||
// Lostorage
|
||||
this.coin = info.coin || 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);
|
||||
card.isUp = arg.up;
|
||||
card.isFaceup = arg.faceup;
|
||||
|
|
Loading…
Reference in a new issue