replaced various instances of instanceof lambda functions with

This commit is contained in:
Evan Kranzler 2022-04-03 11:11:07 -04:00
parent 26ef55c1bc
commit 26ae7b7281
21 changed files with 37 additions and 46 deletions

View file

@ -57,10 +57,10 @@ public class Brawl extends Constructed {
Iterator<Card> iter = deck.getSideboard().iterator();
Card card1 = iter.next();
Card card2 = iter.next();
if (card1.getAbilities().stream().anyMatch(ability -> ability instanceof CompanionAbility)) {
if (card1.getAbilities().stream().anyMatch(CompanionAbility.class::isInstance)) {
companion = card1;
brawler = card2;
} else if (card2.getAbilities().stream().anyMatch(ability -> ability instanceof CompanionAbility)) {
} else if (card2.getAbilities().stream().anyMatch(CompanionAbility.class::isInstance)) {
companion = card2;
brawler = card1;
} else {

View file

@ -1482,7 +1482,7 @@ public class HumanPlayer extends PlayerImpl {
// can't see lands as playable and must know the reason (if they click on land then they get that message)
if (abilityToCast.getAbilityType() == AbilityType.SPELL) {
Spell spell = game.getStack().getSpell(abilityToCast.getSourceId());
boolean haveManaAbilities = object.getAbilities().stream().anyMatch(a -> a instanceof ManaAbility);
boolean haveManaAbilities = object.getAbilities().stream().anyMatch(ManaAbility.class::isInstance);
if (spell != null && !spell.isResolving() && haveManaAbilities) {
switch (spell.getCurrentActivatingManaAbilitiesStep()) {
// if you used special mana ability like convoke then normal mana abilities will be restricted to use, see Convoke for details