mirror of
https://github.com/webxoss/webxoss-core.git
synced 2024-11-19 22:39:53 +01:00
🐛 fix moving trap when rearrange signis
This commit is contained in:
parent
3fa794e683
commit
785ba75b1c
2 changed files with 8 additions and 2 deletions
4
Card.js
4
Card.js
|
@ -1141,8 +1141,8 @@ Card.prototype.changeSigniZone = function (zone) {
|
|||
|
||||
// 交换 zone.cards
|
||||
var oldZone = this.zone;
|
||||
var tmp = oldZone.cards;
|
||||
oldZone.cards = zone.cards;
|
||||
var tmp = oldZone.getNonTrapCards().concat(zone.trap || []);
|
||||
oldZone.cards = zone.getNonTrapCards().concat(oldZone.trap || []);
|
||||
zone.cards = tmp;
|
||||
// 设置 card.zone
|
||||
oldZone.cards.forEach(function (card) {
|
||||
|
|
6
Zone.js
6
Zone.js
|
@ -59,6 +59,12 @@ Zone.prototype.getActualCards = function () {
|
|||
},this);
|
||||
};
|
||||
|
||||
Zone.prototype.getNonTrapCards = function() {
|
||||
return this.cards.filter(function (card) {
|
||||
return (card !== this.trap);
|
||||
},this);
|
||||
};
|
||||
|
||||
Zone.prototype.getSigni = function() {
|
||||
return this.player.signis.filter(function (signi) {
|
||||
return signi.zone === this;
|
||||
|
|
Loading…
Reference in a new issue