mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 02:38:02 +00:00
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:
@@ -537,7 +537,6 @@ public class PhaseHandler implements java.io.Serializable {
|
|||||||
|
|
||||||
if (!possibleExerters.isEmpty()) {
|
if (!possibleExerters.isEmpty()) {
|
||||||
for(Card exerter : whoDeclares.getController().exertAttackers(possibleExerters)) {
|
for(Card exerter : whoDeclares.getController().exertAttackers(possibleExerters)) {
|
||||||
//exerter.addExtrinsicKeyword("Exerted");
|
|
||||||
exerter.exert();
|
exerter.exert();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -685,7 +685,18 @@ public class PlayerControllerHuman extends PlayerController implements IGameCont
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<Card> exertAttackers(List<Card> attackers) {
|
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
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user