mirror of
https://github.com/correl/mage.git
synced 2024-11-14 19:19:32 +00:00
updated a few card type methods for companions
This commit is contained in:
parent
3dff1783ac
commit
29835786c3
6 changed files with 7 additions and 7 deletions
|
@ -67,6 +67,6 @@ enum KerugaCondition implements CompanionCondition {
|
|||
|
||||
@Override
|
||||
public boolean isLegal(Set<Card> deck, int startingHandSize) {
|
||||
return deck.stream().allMatch(card -> card.isLand() || card.getManaValue() >= 3);
|
||||
return deck.stream().allMatch(card -> card.hasCardTypeForDeckbuilding(CardType.LAND) || card.getManaValue() >= 3);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -69,7 +69,7 @@ enum LurrusOfTheDreamDenCompanionCondition implements CompanionCondition {
|
|||
@Override
|
||||
public boolean isLegal(Set<Card> deck, int startingHandSize) {
|
||||
return deck.stream()
|
||||
.filter(card -> card.isPermanent())
|
||||
.filter(MageObject::isPermanent)
|
||||
.mapToInt(MageObject::getManaValue)
|
||||
.max()
|
||||
.orElse(0) <= 2;
|
||||
|
|
|
@ -86,7 +86,7 @@ enum LutriTheSpellchaserCompanionCondition implements CompanionCondition {
|
|||
public boolean isLegal(Set<Card> deck, int startingHandSize) {
|
||||
Map<String, Integer> cardMap = new HashMap<>();
|
||||
deck.stream()
|
||||
.filter(card -> !card.isLand())
|
||||
.filter(card -> !card.hasCardTypeForDeckbuilding(CardType.LAND))
|
||||
.map(MageObject::getName)
|
||||
.forEach(s -> {
|
||||
cardMap.putIfAbsent(s, 0);
|
||||
|
|
|
@ -61,7 +61,7 @@ enum OboshThePreypiercerCompanionCondition implements CompanionCondition {
|
|||
public boolean isLegal(Set<Card> deck, int startingHandSize) {
|
||||
return deck
|
||||
.stream()
|
||||
.filter(card -> !card.isLand())
|
||||
.filter(card -> !card.hasCardTypeForDeckbuilding(CardType.LAND))
|
||||
.mapToInt(MageObject::getManaValue)
|
||||
.map(i -> i % 2)
|
||||
.allMatch(i -> i == 1);
|
||||
|
|
|
@ -68,7 +68,7 @@ enum UmoriCondition implements CompanionCondition {
|
|||
Set<CardType> cardTypes = new HashSet<>();
|
||||
for (Card card : deck) {
|
||||
// Lands are fine.
|
||||
if (card.isLand()) {
|
||||
if (card.hasCardTypeForDeckbuilding(CardType.LAND)) {
|
||||
continue;
|
||||
}
|
||||
// First nonland checked.
|
||||
|
|
|
@ -76,7 +76,7 @@ enum ZirdaTheDawnwakerCompanionCondition implements CompanionCondition {
|
|||
public boolean isLegal(Set<Card> deck, int startingHandSize) {
|
||||
return deck
|
||||
.stream()
|
||||
.filter(card -> card.isPermanent())
|
||||
.filter(MageObject::isPermanent)
|
||||
.map(MageObject::getAbilities)
|
||||
.flatMap(Collection::stream)
|
||||
.anyMatch(ActivatedAbility.class::isInstance);
|
||||
|
|
Loading…
Reference in a new issue