tests: allow cards to be added to exile during a card test (#11739)

This commit is contained in:
Matthew Wilson 2024-01-31 08:50:04 +02:00 committed by GitHub
parent 9aae17d3f0
commit 0db2599fa5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 33 additions and 3 deletions

View file

@ -3567,7 +3567,7 @@ public abstract class GameImpl implements Game {
}
@Override
public void cheat(UUID ownerId, List<Card> library, List<Card> hand, List<PermanentCard> battlefield, List<Card> graveyard, List<Card> command) {
public void cheat(UUID ownerId, List<Card> library, List<Card> hand, List<PermanentCard> battlefield, List<Card> graveyard, List<Card> command, List<Card> exiled) {
// fake test ability for triggers and events
Ability fakeSourceAbilityTemplate = new SimpleStaticAbility(Zone.OUTSIDE, new InfoEffect("adding testing cards"));
fakeSourceAbilityTemplate.setControllerId(ownerId);
@ -3579,6 +3579,7 @@ public abstract class GameImpl implements Game {
loadCards(ownerId, battlefield);
loadCards(ownerId, graveyard);
loadCards(ownerId, command);
loadCards(ownerId, exiled);
for (Card card : library) {
player.getLibrary().putOnTop(card, this);
@ -3604,6 +3605,11 @@ public abstract class GameImpl implements Game {
throw new IllegalArgumentException("Command zone supports in commander test games");
}
for (Card card : exiled) {
card.setZone(Zone.EXILED, this);
getExile().add(card);
}
for (PermanentCard permanentCard : battlefield) {
Ability fakeSourceAbility = fakeSourceAbilityTemplate.copy();
fakeSourceAbility.setSourceId(permanentCard.getId());