mirror of
https://github.com/correl/mage.git
synced 2024-12-25 11:11:16 +00:00
Performance fix to get out of the loop quicker if library is empty
This commit is contained in:
parent
bf8123b7a5
commit
336732eba2
1 changed files with 9 additions and 8 deletions
|
@ -71,14 +71,15 @@ class ClearTheLandEffect extends OneShotEffect {
|
|||
Library library = player.getLibrary();
|
||||
Cards cardsToReveal = new CardsImpl();
|
||||
for (int i = 0; i < numOfCardsToReveal; i++) {
|
||||
if (library.hasCards()) {
|
||||
Card card = library.getFromTop(game);
|
||||
cardsToReveal.add(card);
|
||||
if (card.isLand()) {
|
||||
player.moveCards(card, Zone.BATTLEFIELD, source, game, tapped, false, true, null);
|
||||
} else {
|
||||
player.moveCards(card, Zone.EXILED, source, game);
|
||||
}
|
||||
if (!library.hasCards()) {
|
||||
break;
|
||||
}
|
||||
Card card = library.getFromTop(game);
|
||||
cardsToReveal.add(card);
|
||||
if (card.isLand()) {
|
||||
player.moveCards(card, Zone.BATTLEFIELD, source, game, tapped, false, true, null);
|
||||
} else {
|
||||
player.moveCards(card, Zone.EXILED, source, game);
|
||||
}
|
||||
}
|
||||
player.revealCards(source, "Revealed cards for " + player.getName(), cardsToReveal, game);
|
||||
|
|
Loading…
Reference in a new issue