From 29c0f4bfaa2d17773d2a3164b314e34045d55280 Mon Sep 17 00:00:00 2001 From: Hanmac Date: Sat, 30 Jul 2016 18:56:50 +0000 Subject: [PATCH] ComputerUtil: chooseTapType add exclude parameter (like using for already selected for tapping) --- forge-ai/src/main/java/forge/ai/ComputerUtil.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/forge-ai/src/main/java/forge/ai/ComputerUtil.java b/forge-ai/src/main/java/forge/ai/ComputerUtil.java index f8fe7169140..4fc3a0bacd0 100644 --- a/forge-ai/src/main/java/forge/ai/ComputerUtil.java +++ b/forge-ai/src/main/java/forge/ai/ComputerUtil.java @@ -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) { + 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 = - CardLists.getValidCards(ai.getCardsIn(ZoneType.Battlefield), type.split(";"), activate.getController(), activate, null); + CardLists.getValidCards(all, type.split(";"), activate.getController(), activate, null); // is this needed? typeList = CardLists.filter(typeList, Presets.UNTAPPED);