use CardView for selection of exterting attackers

Signed-off-by: Jamin W. Collins <jamin.collins@gmail.com>
This commit is contained in:
Jamin W. Collins
2018-04-03 20:12:15 -06:00
parent 2f5a83e171
commit 3f8a3f3342
2 changed files with 12 additions and 2 deletions

View File

@@ -685,7 +685,18 @@ public class PlayerControllerHuman extends PlayerController implements IGameCont
@Override
public List<Card> exertAttackers(List<Card> attackers) {
return getGui().order("Exert Attackers?", "Exerted", 0, attackers.size(), attackers, null, null, false);
HashMap<CardView, Card> mapCVtoC = new HashMap<>();
for (Card card : attackers) {
mapCVtoC.put(card.getView(), card);
}
List<CardView> chosen;
List<CardView> choices = new ArrayList<CardView>(mapCVtoC.keySet());
chosen = getGui().order("Exert Attackers?", "Exerted", 0, choices.size(), choices, null, null, false);
List<Card> chosenCards = new ArrayList<Card>();
for (CardView cardView : chosen) {
chosenCards.add(mapCVtoC.get(cardView));
}
return chosenCards;
}
@Override