Merge branch 'network-play' into 'master'

use CardView for selection of exterting attackers

See merge request core-developers/forge!345
This commit is contained in:
Sol
2018-04-04 02:37:47 +00:00
2 changed files with 12 additions and 2 deletions

View File

@@ -537,7 +537,6 @@ public class PhaseHandler implements java.io.Serializable {
if (!possibleExerters.isEmpty()) {
for(Card exerter : whoDeclares.getController().exertAttackers(possibleExerters)) {
//exerter.addExtrinsicKeyword("Exerted");
exerter.exert();
}
}

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