Search in sources :

Example 1 with CompoundCondition

use of mage.abilities.condition.CompoundCondition in project mage by magefree.

the class SanctuaryInterveningIfTriggeredAbility method makeAndCondition.

private static Condition makeAndCondition(ObjectColor color1, ObjectColor color2) {
    FilterPermanent filter1 = new FilterPermanent();
    filter1.add(new ColorPredicate(color1));
    Condition condition1 = new PermanentsOnTheBattlefieldCondition(filter1);
    FilterPermanent filter2 = new FilterPermanent();
    filter2.add(new ColorPredicate(color2));
    Condition condition2 = new PermanentsOnTheBattlefieldCondition(filter2);
    return new CompoundCondition(condition1, condition2);
}
Also used : ColorPredicate(mage.filter.predicate.mageobject.ColorPredicate) CompoundCondition(mage.abilities.condition.CompoundCondition) Condition(mage.abilities.condition.Condition) PermanentsOnTheBattlefieldCondition(mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition) InvertCondition(mage.abilities.condition.InvertCondition) FilterPermanent(mage.filter.FilterPermanent) PermanentsOnTheBattlefieldCondition(mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition) CompoundCondition(mage.abilities.condition.CompoundCondition)

Aggregations

CompoundCondition (mage.abilities.condition.CompoundCondition)1 Condition (mage.abilities.condition.Condition)1 InvertCondition (mage.abilities.condition.InvertCondition)1 PermanentsOnTheBattlefieldCondition (mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition)1 FilterPermanent (mage.filter.FilterPermanent)1 ColorPredicate (mage.filter.predicate.mageobject.ColorPredicate)1