rewrite loop to stream

This commit is contained in:
Ingmar Goudt 2021-04-25 12:32:44 +02:00
parent 49981ba2a3
commit f74dfcb8b6

View file

@ -56,13 +56,7 @@ public class CastAsThoughItHadFlashAllEffect extends AsThoughEffectImpl {
if (card != null) { if (card != null) {
//Allow lands with morph to be played at instant speed //Allow lands with morph to be played at instant speed
if (card.isLand()) { if (card.isLand()) {
boolean morphAbility = false; boolean morphAbility = card.getAbilities().stream().anyMatch(ability -> ability instanceof MorphAbility);
for (Ability checkAbility : card.getAbilities()) {
if (checkAbility instanceof MorphAbility) {
morphAbility = true;
break;
}
}
if (morphAbility) { if (morphAbility) {
Card cardCopy = card.copy(); Card cardCopy = card.copy();
cardCopy.getCardType().clear(); cardCopy.getCardType().clear();