forked from External/mage
[LCI] Implement Deeproot Pilgrimage (#11350)
This commit is contained in:
parent
77b9faad84
commit
27b8d3e198
9 changed files with 298 additions and 4 deletions
|
|
@ -1,5 +1,6 @@
|
|||
package mage.game;
|
||||
|
||||
import static java.util.Collections.emptyList;
|
||||
import mage.MageObject;
|
||||
import mage.MageObjectReference;
|
||||
import mage.abilities.*;
|
||||
|
|
@ -44,8 +45,6 @@ import java.util.*;
|
|||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static java.util.Collections.emptyList;
|
||||
|
||||
/**
|
||||
* @author BetaSteward_at_googlemail.com
|
||||
* <p>
|
||||
|
|
@ -860,6 +859,27 @@ public class GameState implements Serializable, Copyable<GameState> {
|
|||
}
|
||||
}
|
||||
|
||||
public void addSimultaneousTapped(TappedEvent tappedEvent, Game game) {
|
||||
// Combine multiple tapped events in the single event (batch)
|
||||
|
||||
boolean isTappedBatchUsed = false;
|
||||
for (GameEvent event : simultaneousEvents) {
|
||||
if (event instanceof TappedBatchEvent) {
|
||||
// Adding to the existing batch
|
||||
((TappedBatchEvent) event).addEvent(tappedEvent);
|
||||
isTappedBatchUsed = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// new batch
|
||||
if (!isTappedBatchUsed) {
|
||||
TappedBatchEvent batch = new TappedBatchEvent();
|
||||
batch.addEvent(tappedEvent);
|
||||
addSimultaneousEvent(batch, game);
|
||||
}
|
||||
}
|
||||
|
||||
public void handleEvent(GameEvent event, Game game) {
|
||||
watchers.watch(event, game);
|
||||
delayed.checkTriggers(event, game);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue