mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 20:28:00 +00:00
- Moved CardsAddedThisTurn registration from Zone.add to changeZone.
This commit is contained in:
@@ -227,7 +227,8 @@ public class GameAction {
|
|||||||
}
|
}
|
||||||
zoneFrom.remove(c);
|
zoneFrom.remove(c);
|
||||||
}
|
}
|
||||||
|
ZoneType fromZoneType = zoneFrom == null ? null : zoneFrom.getZoneType();
|
||||||
|
zoneTo.getCardsAddedThisTurn().add(fromZoneType, c);
|
||||||
// "enter the battlefield as a copy" - apply code here
|
// "enter the battlefield as a copy" - apply code here
|
||||||
// but how to query for input here and continue later while the callers assume synchronous result?
|
// but how to query for input here and continue later while the callers assume synchronous result?
|
||||||
zoneTo.add(copied, position);
|
zoneTo.add(copied, position);
|
||||||
|
|||||||
@@ -78,14 +78,6 @@ public class Zone implements IZone, java.io.Serializable, Iterable<Card> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void add(final Card c, final Integer index) {
|
public void add(final Card c, final Integer index) {
|
||||||
// Immutable cards are usually emblems,effects and the mana pool and we
|
|
||||||
// don't want to log those.
|
|
||||||
if (!c.isImmutable()) {
|
|
||||||
final Zone oldZone = game.getZoneOf(c);
|
|
||||||
// if any tokens come to battlefield, consider they are from stack. Plain "null" cannot be a key of EnumMap
|
|
||||||
final ZoneType zt = oldZone == null ? ZoneType.Stack : oldZone.getZoneType();
|
|
||||||
cardsAddedThisTurn.add(zt, c);
|
|
||||||
}
|
|
||||||
|
|
||||||
c.setTurnInZone(game.getPhaseHandler().getTurn());
|
c.setTurnInZone(game.getPhaseHandler().getTurn());
|
||||||
if (zoneType != ZoneType.Battlefield) {
|
if (zoneType != ZoneType.Battlefield) {
|
||||||
@@ -174,6 +166,15 @@ public class Zone implements IZone, java.io.Serializable, Iterable<Card> {
|
|||||||
return this.cardList.isEmpty();
|
return this.cardList.isEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* Getter for the field <code>cardsAddedThisTurn</code>.
|
||||||
|
* </p>
|
||||||
|
*/
|
||||||
|
public final MapOfLists<ZoneType, Card> getCardsAddedThisTurn() {
|
||||||
|
return cardsAddedThisTurn;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
* Getter for the field <code>cardsAddedThisTurn</code>.
|
* Getter for the field <code>cardsAddedThisTurn</code>.
|
||||||
|
|||||||
Reference in New Issue
Block a user