forked from External/mage
* Delay triggered abilities - fixed that copied spell with multiple delayed triggered abilities can freeze the game or missing from stack (#5437);
This commit is contained in:
parent
5aaec29361
commit
2ca1643b54
4 changed files with 53 additions and 28 deletions
|
|
@ -13,14 +13,18 @@ import mage.game.permanent.Permanent;
|
|||
import mage.game.permanent.PermanentToken;
|
||||
import mage.target.targetpointer.TargetPointer;
|
||||
import mage.util.GameLog;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author BetaSteward_at_googlemail.com
|
||||
*/
|
||||
public class CardsView extends LinkedHashMap<UUID, CardView> {
|
||||
|
||||
private static final Logger LOGGER = Logger.getLogger(CardsView.class);
|
||||
|
||||
public CardsView() {
|
||||
}
|
||||
|
||||
|
|
@ -151,6 +155,11 @@ public class CardsView extends LinkedHashMap<UUID, CardView> {
|
|||
this.put(ability.getId(), abilityView);
|
||||
}
|
||||
}
|
||||
|
||||
if (this.size() != abilities.size()) {
|
||||
LOGGER.error("Can't translate abilities list to cards view (need " + abilities.size() + ", but get " + this.size() + "). Abilities:\n"
|
||||
+ abilities.stream().map(a -> a.getClass().getSimpleName() + " - " + a.getRule()).collect(Collectors.joining("\n")));
|
||||
}
|
||||
}
|
||||
|
||||
public CardsView(Collection<? extends Ability> abilities, GameState state) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue