forked from External/mage
fix and rework commander validation (fixes #10345)
This commit is contained in:
parent
85aaaec468
commit
fa03c6404f
8 changed files with 145 additions and 57 deletions
|
|
@ -0,0 +1,28 @@
|
|||
package mage.util.validation;
|
||||
|
||||
import mage.abilities.common.ChooseABackgroundAbility;
|
||||
import mage.cards.Card;
|
||||
import mage.constants.SubType;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public enum ChooseABackgroundValidator implements CommanderValidator {
|
||||
instance;
|
||||
|
||||
@Override
|
||||
public boolean checkPartner(Card commander1, Card commander2) {
|
||||
return commander1.getAbilities().containsClass(ChooseABackgroundAbility.class)
|
||||
&& commander2.hasSubTypeForDeckbuilding(SubType.BACKGROUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkBothPartners(Card commander1, Card commander2) {
|
||||
return checkPartner(commander1, commander2) || checkPartner(commander2, commander1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean specialCheck(Card commander) {
|
||||
return commander.hasSubTypeForDeckbuilding(SubType.BACKGROUND);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue