ComputerUtil: chooseTapType add exclude parameter (like using for already selected for tapping)

This commit is contained in:
Hanmac
2016-07-30 18:56:50 +00:00
parent c3bd44f604
commit 29c0f4bfaa

View File

@@ -449,8 +449,13 @@ public class ComputerUtil {
} }
public static CardCollection chooseTapType(final Player ai, final String type, final Card activate, final boolean tap, final int amount) { public static CardCollection chooseTapType(final Player ai, final String type, final Card activate, final boolean tap, final int amount) {
return chooseTapType(ai, type, activate, tap, amount, CardCollection.EMPTY);
}
public static CardCollection chooseTapType(final Player ai, final String type, final Card activate, final boolean tap, final int amount, final CardCollectionView exclude) {
CardCollection all = new CardCollection(ai.getCardsIn(ZoneType.Battlefield));
all.removeAll(exclude);
CardCollection typeList = CardCollection typeList =
CardLists.getValidCards(ai.getCardsIn(ZoneType.Battlefield), type.split(";"), activate.getController(), activate, null); CardLists.getValidCards(all, type.split(";"), activate.getController(), activate, null);
// is this needed? // is this needed?
typeList = CardLists.filter(typeList, Presets.UNTAPPED); typeList = CardLists.filter(typeList, Presets.UNTAPPED);