mirror of
https://github.com/magefree/mage.git
synced 2026-01-26 21:29:17 -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
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue