forked from External/mage
replaced various instances of instanceof lambda functions with
This commit is contained in:
parent
26ef55c1bc
commit
26ae7b7281
21 changed files with 37 additions and 46 deletions
|
|
@ -418,7 +418,7 @@ public abstract class ContinuousEffectImpl extends EffectImpl implements Continu
|
|||
// extraPredicates from some filters is player related, you don't need it here
|
||||
List<Predicate> list = new ArrayList<>();
|
||||
Predicates.collectAllComponents(filter.getPredicates(), list);
|
||||
if (list.stream().anyMatch(p -> p instanceof SubType.SubTypePredicate)) {
|
||||
if (list.stream().anyMatch(SubType.SubTypePredicate.class::isInstance)) {
|
||||
this.addDependedToType(DependencyType.AddingCreatureType);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -118,7 +118,7 @@ class CipherStoreEffect extends OneShotEffect {
|
|||
Card copyCard = game.copyCard(cipherCard, source, controller.getId());
|
||||
SpellAbility ability = copyCard.getSpellAbility();
|
||||
// remove the cipher effect from the copy
|
||||
ability.getEffects().removeIf(effect -> effect instanceof CipherEffect);
|
||||
ability.getEffects().removeIf(CipherEffect.class::isInstance);
|
||||
controller.cast(ability, game, true, new ApprovingObject(source, game));
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ public class CastAsThoughItHadFlashAllEffect extends AsThoughEffectImpl {
|
|||
if (card != null) {
|
||||
//Allow lands with morph to be played at instant speed
|
||||
if (card.isLand(game)) {
|
||||
boolean morphAbility = card.getAbilities().stream().anyMatch(ability -> ability instanceof MorphAbility);
|
||||
boolean morphAbility = card.getAbilities().stream().anyMatch(MorphAbility.class::isInstance);
|
||||
if (morphAbility) {
|
||||
Card cardCopy = card.copy();
|
||||
cardCopy.removeAllCardTypes(game);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue