mirror of
https://github.com/magefree/mage.git
synced 2025-12-28 06:22:01 -08:00
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
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue