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

@ -3706,7 +3706,7 @@ public abstract class PlayerImpl implements Player, Serializable {
ManaOptions manaFull = availableMana.copy();
if (ability instanceof SpellAbility) {
for (AlternateManaPaymentAbility altAbility : CardUtil.getAbilities(object, game).stream()
.filter(a -> a instanceof AlternateManaPaymentAbility)
.filter(AlternateManaPaymentAbility.class::isInstance)
.map(a -> (AlternateManaPaymentAbility) a)
.collect(Collectors.toList())) {
ManaOptions manaSpecial = altAbility.getManaOptions(ability, game, ability.getManaCostsToPay());
@ -3739,7 +3739,7 @@ public abstract class PlayerImpl implements Player, Serializable {
if (ability instanceof AlternativeSourceCosts && object != null && !(object instanceof Permanent)) {
ActivatedAbility playAbility = null;
if (object.isLand(game)) {
playAbility = (PlayLandAbility) CardUtil.getAbilities(object, game).stream().filter(a -> a instanceof PlayLandAbility).findFirst().orElse(null);
playAbility = (PlayLandAbility) CardUtil.getAbilities(object, game).stream().filter(PlayLandAbility.class::isInstance).findFirst().orElse(null);
} else if (object instanceof Card) {
playAbility = ((Card) object).getSpellAbility();
}